From 12342f213fc54a38b4ee33e5e07f6b24c77561c9 Mon Sep 17 00:00:00 2001
From: David Emschermann <d.emschermann@gsi.de>
Date: Thu, 17 Mar 2022 09:28:18 +0100
Subject: [PATCH] Move mCBM geometry generation macros to the geometry
 repository, refs #2474

---
 .../geometry/Create_TOF_Geometry_v18m_mCbm.C  | 1324 -----
 macro/mcbm/geometry/README.md                 |    8 +
 macro/mcbm/geometry/create_platform_v18a.C    |  176 -
 macro/mcbm/geometry/create_platform_v18c.C    |  178 -
 macro/mcbm/geometry/create_platform_v18d.C    |  180 -
 .../geometry/much/create_MUCH_geometry_v18b.C |  395 --
 .../geometry/much/create_MUCH_geometry_v18c.C |  407 --
 .../geometry/much/create_MUCH_geometry_v18d.C |  407 --
 .../geometry/much/create_MUCH_geometry_v18e.C |  409 --
 .../much/create_MUCH_geometry_v18e1.C         |  411 --
 .../geometry/much/create_MUCH_geometry_v18f.C |  412 --
 .../geometry/much/create_MUCH_geometry_v18g.C |  411 --
 .../geometry/much/create_MUCH_geometry_v18h.C |  484 --
 .../geometry/much/create_MUCH_geometry_v18i.C |  413 --
 .../geometry/much/create_MUCH_geometry_v18j.C |  414 --
 .../much/create_MUCH_geometry_v19a_mcbm.C     |  415 --
 .../much/create_MUCH_geometry_v19b_mcbm.C     |  416 --
 .../much/create_MUCH_geometry_v19c_mcbm.C     |  422 --
 .../much/create_MUCH_geometry_v19d_mcbm.C     |  422 --
 .../much/create_MUCH_geometry_v20a_mcbm.C     |  453 --
 .../much/create_MUCH_geometry_v22a_mcbm.C     |  442 --
 .../much/create_MUCH_geometry_v22b_mcbm.C     |  442 --
 .../much/create_MUCH_geometry_v22c_mcbm.C     |  442 --
 .../much/create_MUCH_geometry_v22d_mcbm.C     |  442 --
 .../much/create_MUCH_geometry_v22e_mcbm.C     |  774 ---
 .../much/create_MUCH_geometry_v22f_mcbm.C     |  767 ---
 .../pipe/create_bpipe_geometry_v18a.C         |  374 --
 .../pipe/create_bpipe_geometry_v18b.C         |  370 --
 .../pipe/create_bpipe_geometry_v18c.C         |  381 --
 .../pipe/create_bpipe_geometry_v18d.C         |  304 --
 .../pipe/create_bpipe_geometry_v18e.C         |  306 --
 .../pipe/create_bpipe_geometry_v18f.C         |  308 --
 .../pipe/create_bpipe_geometry_v18g.C         |  309 --
 .../pipe/create_bpipe_geometry_v19a.C         |  291 -
 .../geometry/platform/create_platform_v18a.C  |  176 -
 .../geometry/platform/create_platform_v18c.C  |  178 -
 .../geometry/platform/create_platform_v18d.C  |  180 -
 .../geometry/platform/create_platform_v20a.C  |  193 -
 macro/mcbm/geometry/psd/create_psdgeo_v18a.C  |  469 --
 macro/mcbm/geometry/psd/create_psdgeo_v18b.C  |  473 --
 macro/mcbm/geometry/psd/create_psdgeo_v18c.C  |  470 --
 macro/mcbm/geometry/psd/create_psdgeo_v18d.C  |  471 --
 macro/mcbm/geometry/psd/create_psdgeo_v18e.C  |  472 --
 macro/mcbm/geometry/psd/create_psdgeo_v20a.C  |  473 --
 .../geometry/rich/create_rich_v18a_mcbm.C     |  282 -
 .../geometry/rich/create_rich_v18b_mcbm.C     |  321 --
 .../geometry/rich/create_rich_v18c_mcbm.C     |  322 --
 .../geometry/rich/create_rich_v18d_gp_mcbm.C  |  351 --
 .../geometry/rich/create_rich_v18d_mcbm.C     |  374 --
 .../geometry/rich/create_rich_v18e_mcbm.C     |  380 --
 .../geometry/rich/create_rich_v18f_mcbm.C     |  381 --
 .../geometry/rich/create_rich_v18g_mcbm.C     |  384 --
 .../geometry/rich/create_rich_v18h_mcbm.C     |  388 --
 .../geometry/rich/create_rich_v19a_mcbm.C     |  345 --
 .../geometry/rich/create_rich_v19b_mcbm.C     |  351 --
 .../geometry/rich/create_rich_v19c_mcbm.C     |  348 --
 .../geometry/rich/create_rich_v19d_mcbm.C     |  349 --
 .../geometry/rich/create_rich_v19e_mcbm.C     |  350 --
 .../geometry/rich/create_rich_v20b_mcbm.C     |  353 --
 .../geometry/rich/create_rich_v20c_mcbm.C     |  353 --
 .../geometry/rich/create_rich_v20d_mcbm.C     |  357 --
 .../geometry/rich/create_rich_v21a_mcbm.C     |  365 --
 .../geometry/rich/create_rich_v21b_mcbm.C     |  375 --
 macro/mcbm/geometry/sts/.rootrc               |    1 -
 macro/mcbm/geometry/sts/create_stsgeo_v18a.C  | 1784 ------
 macro/mcbm/geometry/sts/create_stsgeo_v18b.C  | 1784 ------
 macro/mcbm/geometry/sts/create_stsgeo_v18c.C  | 2159 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18d.C  | 2150 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18e.C  | 2354 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18f.C  | 2363 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18g.C  | 2365 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18h.C  | 2423 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v18i.C  | 2368 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18j.C  | 2490 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v18k.C  | 2495 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v18l.C  | 2364 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18m.C  | 2365 --------
 macro/mcbm/geometry/sts/create_stsgeo_v18n.C  | 2366 --------
 macro/mcbm/geometry/sts/create_stsgeo_v19a.C  | 2391 --------
 macro/mcbm/geometry/sts/create_stsgeo_v19b.C  | 2419 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v19c.C  | 2396 --------
 macro/mcbm/geometry/sts/create_stsgeo_v19d.C  | 2413 --------
 macro/mcbm/geometry/sts/create_stsgeo_v19e.C  | 2461 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v19f.C  | 2369 --------
 macro/mcbm/geometry/sts/create_stsgeo_v19g.C  | 1320 -----
 macro/mcbm/geometry/sts/create_stsgeo_v20a.C  | 2457 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v20b.C  | 2456 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v20c.C  | 2453 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v20d.C  | 2458 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v20e.C  | 2455 ---------
 macro/mcbm/geometry/sts/create_stsgeo_v22a.C  | 2757 ----------
 macro/mcbm/geometry/sts/create_stsgeo_v22b.C  | 2766 ----------
 macro/mcbm/geometry/sts/create_stsgeo_v22c.C  | 2767 ----------
 .../mcbm/geometry/sts/no_keeping_volume.patch |   40 -
 .../targetbox/create_bpipe_geometry_v19b.C    |  535 --
 .../targetbox/create_bpipe_geometry_v19c.C    |  536 --
 .../targetbox/create_bpipe_geometry_v19d.C    |  550 --
 .../targetbox/create_bpipe_geometry_v19e.C    |  582 --
 .../targetbox/create_bpipe_geometry_v19f.C    |  572 --
 .../targetbox/create_bpipe_geometry_v19g.C    |  573 --
 .../targetbox/create_bpipe_geometry_v19h.C    |  575 --
 .../targetbox/create_bpipe_geometry_v20a.C    |  654 ---
 macro/mcbm/geometry/targetbox/ctub_orig.C     |   37 -
 macro/mcbm/geometry/targetbox/cutout1.C       |  206 -
 macro/mcbm/geometry/targetbox/cutout2.C       |  208 -
 macro/mcbm/geometry/targetbox/targetbox1.C    |  152 -
 macro/mcbm/geometry/targetbox/targetbox2.C    |  333 --
 macro/mcbm/geometry/targetbox/targetbox3.C    |  354 --
 .../geometry/tof/Create_TOF_Geometry_mCBM_1.C |  395 --
 .../geometry/tof/Create_TOF_Geometry_v18_1x.C | 1078 ----
 .../geometry/tof/Create_TOF_Geometry_v18_2x.C | 1081 ----
 .../geometry/tof/Create_TOF_Geometry_v18_3x.C | 1109 ----
 .../tof/Create_TOF_Geometry_v18d_mcbm.C       | 1065 ----
 .../tof/Create_TOF_Geometry_v18e_mcbm.C       | 1070 ----
 .../tof/Create_TOF_Geometry_v18f_mcbm.C       | 1075 ----
 .../tof/Create_TOF_Geometry_v18g_mcbm.C       | 1081 ----
 .../tof/Create_TOF_Geometry_v18h_mcbm.C       | 1081 ----
 .../tof/Create_TOF_Geometry_v18i_mcbm.C       | 1083 ----
 .../tof/Create_TOF_Geometry_v18j_mcbm.C       | 1087 ----
 .../tof/Create_TOF_Geometry_v18k_mcbm.C       | 1148 ----
 .../tof/Create_TOF_Geometry_v18l_mcbm.C       | 1149 ----
 .../tof/Create_TOF_Geometry_v19a_mcbm.C       | 1324 -----
 .../tof/Create_TOF_Geometry_v19b_mcbm.C       | 1327 -----
 .../tof/Create_TOF_Geometry_v19c_mcbm.C       | 1330 -----
 .../tof/Create_TOF_Geometry_v19d_mcbm.C       | 1310 -----
 .../tof/Create_TOF_Geometry_v19e_mcbm.C       | 1312 -----
 .../tof/Create_TOF_Geometry_v20a_cosmicHD.C   | 1365 -----
 .../tof/Create_TOF_Geometry_v20a_mcbm.C       | 1334 -----
 .../tof/Create_TOF_Geometry_v20b_cosmicHD.C   | 1371 -----
 .../tof/Create_TOF_Geometry_v20b_mcbm.C       | 1347 -----
 .../tof/Create_TOF_Geometry_v20c_mcbm.C       | 1335 -----
 .../tof/Create_TOF_Geometry_v20d_cosmicHD.C   | 1382 -----
 .../tof/Create_TOF_Geometry_v20d_mcbm.C       | 1338 -----
 .../tof/Create_TOF_Geometry_v20e_mcbm.C       | 1363 -----
 .../tof/Create_TOF_Geometry_v20f_mcbm.C       | 1353 -----
 .../tof/Create_TOF_Geometry_v21a_mcbm.C       | 1354 -----
 .../tof/Create_TOF_Geometry_v21b_mcbm.C       | 1354 -----
 .../tof/Create_TOF_Geometry_v21c_mcbm.C       | 1281 -----
 .../tof/Create_TOF_Geometry_v21d_mcbm.C       | 1282 -----
 .../tof/Create_TOF_Geometry_v22a_mcbm.C       | 1308 -----
 macro/mcbm/geometry/tof/HowTo_digipar.txt     |   18 -
 macro/mcbm/geometry/tof/create_digipar.C      |  110 -
 macro/mcbm/geometry/tof/create_parfiles.sh    |   35 -
 macro/mcbm/geometry/tof/create_tof_digipar.C  |  111 -
 .../mcbm/geometry/tof/create_tof_geometry.sh  |   15 -
 macro/mcbm/geometry/trd/.rootrc               |    1 -
 .../mcbm/geometry/trd/CbmTrdPads_v18q_mcbm.h  |   70 -
 .../geometry/trd/Create_TRD_Geometry_v17s.C   | 3730 -------------
 .../trd/Create_TRD_Geometry_v18a_1e.C         | 3310 -----------
 .../trd/Create_TRD_Geometry_v18b_1e.C         | 3288 -----------
 .../trd/Create_TRD_Geometry_v18c_1e.C         | 3296 -----------
 .../trd/Create_TRD_Geometry_v18d_1e.C         | 3299 -----------
 .../geometry/trd/Create_TRD_Geometry_v18e.C   | 3729 -------------
 .../geometry/trd/Create_TRD_Geometry_v18f.C   | 3699 -------------
 .../geometry/trd/Create_TRD_Geometry_v18g.C   | 3730 -------------
 .../geometry/trd/Create_TRD_Geometry_v18h.C   | 4062 --------------
 .../geometry/trd/Create_TRD_Geometry_v18i.C   | 4094 --------------
 .../geometry/trd/Create_TRD_Geometry_v18j.C   | 4100 --------------
 .../geometry/trd/Create_TRD_Geometry_v18k.C   | 4101 --------------
 .../geometry/trd/Create_TRD_Geometry_v18l.C   | 4104 --------------
 .../geometry/trd/Create_TRD_Geometry_v18m.C   | 4109 --------------
 .../geometry/trd/Create_TRD_Geometry_v18n.C   | 4109 --------------
 .../geometry/trd/Create_TRD_Geometry_v18o.C   | 4119 --------------
 .../geometry/trd/Create_TRD_Geometry_v18p.C   | 4120 --------------
 .../geometry/trd/Create_TRD_Geometry_v18q.C   | 4110 --------------
 .../geometry/trd/Create_TRD_Geometry_v18r.C   | 4110 --------------
 .../geometry/trd/Create_TRD_Geometry_v20a.C   | 4228 --------------
 .../geometry/trd/Create_TRD_Geometry_v20b.C   | 4229 --------------
 .../geometry/trd/Create_TRD_Geometry_v21b.C   | 4568 ----------------
 .../geometry/trd/Create_TRD_Geometry_v21c.C   | 4578 ----------------
 .../geometry/trd/Create_TRD_Geometry_v21d.C   | 4587 ----------------
 .../geometry/trd/Create_TRD_Geometry_v22a.C   | 4825 ----------------
 .../geometry/trd/Create_TRD_Geometry_v22b.C   | 4574 ----------------
 .../geometry/trd/Create_TRD_Geometry_v22c.C   | 4569 ----------------
 .../geometry/trd/Create_TRD_Geometry_v22d.C   | 4590 ----------------
 .../geometry/trd/Create_TRD_Geometry_v22e.C   | 4837 -----------------
 .../geometry/trd/Create_TRD_Geometry_v22f.C   | 4585 ----------------
 macro/mcbm/geometry/trd_root6.patch           |  366 --
 macro/mcbm/geometry/trd_v17a_to_v18e.patch    |  242 -
 179 files changed, 8 insertions(+), 261690 deletions(-)
 delete mode 100644 macro/mcbm/geometry/Create_TOF_Geometry_v18m_mCbm.C
 create mode 100644 macro/mcbm/geometry/README.md
 delete mode 100644 macro/mcbm/geometry/create_platform_v18a.C
 delete mode 100644 macro/mcbm/geometry/create_platform_v18c.C
 delete mode 100644 macro/mcbm/geometry/create_platform_v18d.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18b.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18c.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18d.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18e.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18e1.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18f.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18g.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18h.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18i.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v18j.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v19a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v19b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v19c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v19d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v20a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v22a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v22b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v22c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v22d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v22e_mcbm.C
 delete mode 100644 macro/mcbm/geometry/much/create_MUCH_geometry_v22f_mcbm.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v18a.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v18b.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v18c.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v18d.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v18e.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v18f.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v18g.C
 delete mode 100644 macro/mcbm/geometry/pipe/create_bpipe_geometry_v19a.C
 delete mode 100644 macro/mcbm/geometry/platform/create_platform_v18a.C
 delete mode 100644 macro/mcbm/geometry/platform/create_platform_v18c.C
 delete mode 100644 macro/mcbm/geometry/platform/create_platform_v18d.C
 delete mode 100644 macro/mcbm/geometry/platform/create_platform_v20a.C
 delete mode 100644 macro/mcbm/geometry/psd/create_psdgeo_v18a.C
 delete mode 100644 macro/mcbm/geometry/psd/create_psdgeo_v18b.C
 delete mode 100644 macro/mcbm/geometry/psd/create_psdgeo_v18c.C
 delete mode 100644 macro/mcbm/geometry/psd/create_psdgeo_v18d.C
 delete mode 100644 macro/mcbm/geometry/psd/create_psdgeo_v18e.C
 delete mode 100644 macro/mcbm/geometry/psd/create_psdgeo_v20a.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18d_gp_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18e_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18f_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18g_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v18h_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v19a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v19b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v19c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v19d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v19e_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v20b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v20c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v20d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v21a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/rich/create_rich_v21b_mcbm.C
 delete mode 120000 macro/mcbm/geometry/sts/.rootrc
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18a.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18b.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18c.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18d.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18e.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18f.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18g.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18h.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18i.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18j.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18k.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18l.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18m.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v18n.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v19a.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v19b.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v19c.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v19d.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v19e.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v19f.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v19g.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v20a.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v20b.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v20c.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v20d.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v20e.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v22a.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v22b.C
 delete mode 100644 macro/mcbm/geometry/sts/create_stsgeo_v22c.C
 delete mode 100644 macro/mcbm/geometry/sts/no_keeping_volume.patch
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19b.C
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19c.C
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19d.C
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19e.C
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19f.C
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19g.C
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19h.C
 delete mode 100644 macro/mcbm/geometry/targetbox/create_bpipe_geometry_v20a.C
 delete mode 100644 macro/mcbm/geometry/targetbox/ctub_orig.C
 delete mode 100644 macro/mcbm/geometry/targetbox/cutout1.C
 delete mode 100644 macro/mcbm/geometry/targetbox/cutout2.C
 delete mode 100644 macro/mcbm/geometry/targetbox/targetbox1.C
 delete mode 100644 macro/mcbm/geometry/targetbox/targetbox2.C
 delete mode 100644 macro/mcbm/geometry/targetbox/targetbox3.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_mCBM_1.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_1x.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_2x.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_3x.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18e_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18f_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18g_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18h_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18i_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18j_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18k_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v18l_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v19a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v19b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v19c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v19d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v19e_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_cosmicHD.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_cosmicHD.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_cosmicHD.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20e_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v21b_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v21c_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v21d_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/Create_TOF_Geometry_v22a_mcbm.C
 delete mode 100644 macro/mcbm/geometry/tof/HowTo_digipar.txt
 delete mode 100644 macro/mcbm/geometry/tof/create_digipar.C
 delete mode 100755 macro/mcbm/geometry/tof/create_parfiles.sh
 delete mode 100644 macro/mcbm/geometry/tof/create_tof_digipar.C
 delete mode 100755 macro/mcbm/geometry/tof/create_tof_geometry.sh
 delete mode 120000 macro/mcbm/geometry/trd/.rootrc
 delete mode 100644 macro/mcbm/geometry/trd/CbmTrdPads_v18q_mcbm.h
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v17s.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18a_1e.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18b_1e.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18c_1e.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18d_1e.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18e.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18f.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18g.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18h.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18i.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18j.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18k.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18l.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18m.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18n.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18o.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18p.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18q.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v18r.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v20a.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v20b.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v21b.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v21c.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v21d.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v22c.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v22d.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v22e.C
 delete mode 100644 macro/mcbm/geometry/trd/Create_TRD_Geometry_v22f.C
 delete mode 100644 macro/mcbm/geometry/trd_root6.patch
 delete mode 100644 macro/mcbm/geometry/trd_v17a_to_v18e.patch

diff --git a/macro/mcbm/geometry/Create_TOF_Geometry_v18m_mCbm.C b/macro/mcbm/geometry/Create_TOF_Geometry_v18m_mCbm.C
deleted file mode 100644
index e3fe497061..0000000000
--- a/macro/mcbm/geometry/Create_TOF_Geometry_v18m_mCbm.C
+++ /dev/null
@@ -1,1324 +0,0 @@
-/* Copyright (C) 2019 PI-UHd, GSI
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Norbert Herrmann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18k_mCbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v18m";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-
-//
-const TString fileTag      = "tof_v18m";
-const TString FileNameSim  = fileTag + "_mCbm.root";
-const TString FileNameGeo  = fileTag + "_mCbm.geo.root";
-const TString FileNameInfo = fileTag + "_mCbm.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 240;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 34.;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 34.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -35.;  //
-const Float_t Buc_Delta_Y_Position     = 0.;    //
-const Float_t Buc_rotate_Z             = 0.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {50.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18m_mCbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-  TGeoVolume* tofstand         = new TGeoVolumeAssembly(geoVersionStand);
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot      = new TGeoRotation();
-  stand_rot->RotateY(1.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  position_cer_modules(3);
-  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/README.md b/macro/mcbm/geometry/README.md
new file mode 100644
index 0000000000..caef4959c9
--- /dev/null
+++ b/macro/mcbm/geometry/README.md
@@ -0,0 +1,8 @@
+Geometries for mCBM
+=========================================
+
+# 1. Geometry macros
+
+The geometry macros moved to the following folder:
+
+geometry/<subsystem>/mcbm
diff --git a/macro/mcbm/geometry/create_platform_v18a.C b/macro/mcbm/geometry/create_platform_v18a.C
deleted file mode 100644
index b6d10639bd..0000000000
--- a/macro/mcbm/geometry/create_platform_v18a.C
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Copyright (C) 2013-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_pipegeo_v16.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 11.10.2013
- **
- ** The beam pipe is composed of carbon with a thickness of 0.5 mm. It is
- ** placed directly into the cave as mother volume.
- ** The pipe consists of a number of parts. Each part has a PCON
- ** shape. The beam pipe inside the RICH is part of the RICH geometry;
- ** the beam pipe geometry thus excludes the z range of the RICH in case
- ** the latter is present in the setup.
-  *****************************************************************************/
-
-
-#include "TGeoManager.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-// -------------   Other global variables   -----------------------------------
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_platform_v18a()
-{
-
-  // -----   Define platform parts   ----------------------------------------------
-
-  /** For v18a (mCBM)   **/
-  TString geoTag = "v18a_mcbm";
-
-  //  Double_t platform_angle = 25.;  // rotation angle around y-axis
-  Double_t platform_angle = 19.;    // rotation angle around y-axis
-  Double_t platX_offset   = -230.;  // offset to the right side along x-axis
-
-  Double_t sizeX = 80.0;   // symmetric in x
-  Double_t sizeY = 200.0;  // without rails
-  Double_t sizeZ = 500.0;  // short version
-
-  //  Double_t endZ  = 450.0;  // ends at z = 450.0
-
-  //  /** For v16b (SIS 300)   **/
-  //  TString geoTag = "v16b";
-  //  Double_t sizeX = 725.0;  // symmetric in x
-  //  Double_t sizeY = 234.0;  // without rails
-  //  Double_t sizeZ = 455.0;  // long version
-  //  Double_t endZ  = 540.0;  // ends at z = 450.0
-
-  //  Double_t beamY = 570.0;  // nominal beam height
-  Double_t beamY = 100.0;  // nominal beam height
-  Double_t posX  = -sizeX / 2.;
-  Double_t posY  = -beamY + sizeY / 2.;  // rest on the floor at -beamY
-  Double_t posZ  = +sizeZ / 2.;
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "platform_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "Platform geometry created with create_platform_v16.C" << std::endl << std::endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> aluminium
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (!mAluminium) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  if (!aluminium) Fatal("Main", "Medium aluminium not found");
-
-  //  // ---> air
-  //  FairGeoMedium* mAir  = geoMedia->getMedium("air");
-  //  if ( ! mAir ) Fatal("Main", "FairMedium air not found");
-  //  geoBuild->createMedium(mAir);
-  //  TGeoMedium* air = gGeoMan->GetMedium("air");
-  //  if ( ! air ) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PLATFORMgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-  TString platformName = "platform_";
-  platformName += geoTag;
-  TGeoVolume* platform = new TGeoVolumeAssembly(platformName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create   ---------------------------------------------------------
-  TGeoBBox* platform_base  = new TGeoBBox("", sizeX / 2., sizeY / 2., sizeZ / 2.);
-  TGeoVolume* platform_vol = new TGeoVolume("platform", platform_base, aluminium);
-  platform_vol->SetLineColor(kBlue);
-  platform_vol->SetTransparency(70);
-
-  TGeoTranslation* platform_trans = new TGeoTranslation("", posX, posY, posZ);
-  platform->AddNode(platform_vol, 1, platform_trans);
-
-  infoFile << "sizeX: " << setprecision(2) << sizeX << "sizeY: " << setprecision(2) << sizeY
-           << "sizeZ: " << setprecision(2) << sizeZ << endl;
-  infoFile << "posX : " << setprecision(2) << posX << "posY : " << setprecision(2) << posY
-           << "posZ : " << setprecision(2) << posZ << endl;
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(platform, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  platform->Export(geoFileName);  // an alternative way of writing the platform volume
-
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-
-  // rotate the platform around y
-  TGeoRotation* platform_rotation = new TGeoRotation();
-  platform_rotation->RotateY(platform_angle);
-  //  TGeoCombiTrans* platform_placement = new TGeoCombiTrans( sin( platform_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., platform_rotation);
-  TGeoCombiTrans* platform_placement = new TGeoCombiTrans("platform_rot", platX_offset, 0., 0, platform_rotation);
-
-
-  //  TGeoTranslation* platform_placement = new TGeoTranslation("platform_trans", 0., 0., 0.);
-  platform_placement->Write();
-  geoFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
diff --git a/macro/mcbm/geometry/create_platform_v18c.C b/macro/mcbm/geometry/create_platform_v18c.C
deleted file mode 100644
index e97945a304..0000000000
--- a/macro/mcbm/geometry/create_platform_v18c.C
+++ /dev/null
@@ -1,178 +0,0 @@
-/* Copyright (C) 2013-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_pipegeo_v16.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 11.10.2013
- **
- ** The beam pipe is composed of carbon with a thickness of 0.5 mm. It is
- ** placed directly into the cave as mother volume.
- ** The pipe consists of a number of parts. Each part has a PCON
- ** shape. The beam pipe inside the RICH is part of the RICH geometry;
- ** the beam pipe geometry thus excludes the z range of the RICH in case
- ** the latter is present in the setup.
-  *****************************************************************************/
-
-
-#include "TGeoManager.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-// -------------   Other global variables   -----------------------------------
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_platform_v18c()
-{
-
-  // -----   Define platform parts   ----------------------------------------------
-
-  /** For v18c (mCBM)   **/
-  TString geoTag = "v18c_mcbm";
-
-  //  Double_t platform_angle = 25.;  // rotation angle around y-axis
-  //  Double_t platform_angle =   19.;  // rotation angle around y-axis
-  Double_t platform_angle = 0.;  // rotation angle around y-axis
-  //  Double_t platX_offset   = -230.;  // offset to the right side along x-axis
-  Double_t platX_offset = 0.;  // offset to the right side along x-axis
-
-  Double_t sizeX = 80.0;   // table width
-  Double_t sizeY = 80.0;   // table height
-  Double_t sizeZ = 400.0;  // table length
-
-  //  Double_t endZ  = 450.0;  // ends at z = 450.0
-
-  //  /** For v16b (SIS 300)   **/
-  //  TString geoTag = "v16b";
-  //  Double_t sizeX = 725.0;  // symmetric in x
-  //  Double_t sizeY = 234.0;  // without rails
-  //  Double_t sizeZ = 455.0;  // long version
-  //  Double_t endZ  = 540.0;  // ends at z = 450.0
-
-  //  Double_t beamY = 570.0;  // nominal beam height
-  Double_t beamY = 200.0;  // nominal beam height
-  Double_t posX  = 0;
-  Double_t posY  = -beamY + sizeY / 2.;  // rest on the floor at -beamY
-  Double_t posZ  = +sizeZ / 2.;
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "platform_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "Platform geometry created with create_platform_v16.C" << std::endl << std::endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //  // ---> aluminium
-  //  FairGeoMedium* mAluminium      = geoMedia->getMedium("aluminium");
-  //  if ( ! mAluminium ) Fatal("Main", "FairMedium aluminium not found");
-  //  geoBuild->createMedium(mAluminium);
-  //  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  //  if ( ! aluminium ) Fatal("Main", "Medium aluminium not found");
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PLATFORMgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-  TString platformName = "platform_";
-  platformName += geoTag;
-  TGeoVolume* platform = new TGeoVolumeAssembly(platformName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create   ---------------------------------------------------------
-  TGeoBBox* platform_base  = new TGeoBBox("", sizeX / 2., sizeY / 2., sizeZ / 2.);
-  TGeoVolume* platform_vol = new TGeoVolume("platform", platform_base, air);
-  platform_vol->SetLineColor(kBlue);
-  platform_vol->SetTransparency(70);
-
-  TGeoTranslation* platform_trans = new TGeoTranslation("", posX, posY, posZ);
-  platform->AddNode(platform_vol, 1, platform_trans);
-
-  infoFile << "sizeX: " << setprecision(2) << sizeX << "sizeY: " << setprecision(2) << sizeY
-           << "sizeZ: " << setprecision(2) << sizeZ << endl;
-  infoFile << "posX : " << setprecision(2) << posX << "posY : " << setprecision(2) << posY
-           << "posZ : " << setprecision(2) << posZ << endl;
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(platform, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  platform->Export(geoFileName);  // an alternative way of writing the platform volume
-
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-
-  // rotate the platform around y
-  TGeoRotation* platform_rotation = new TGeoRotation();
-  platform_rotation->RotateY(platform_angle);
-  //  TGeoCombiTrans* platform_placement = new TGeoCombiTrans( sin( platform_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., platform_rotation);
-  TGeoCombiTrans* platform_placement = new TGeoCombiTrans("platform_rot", platX_offset, 0., 0, platform_rotation);
-
-
-  //  TGeoTranslation* platform_placement = new TGeoTranslation("platform_trans", 0., 0., 0.);
-  platform_placement->Write();
-  geoFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
diff --git a/macro/mcbm/geometry/create_platform_v18d.C b/macro/mcbm/geometry/create_platform_v18d.C
deleted file mode 100644
index e1cb0afc46..0000000000
--- a/macro/mcbm/geometry/create_platform_v18d.C
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Copyright (C) 2013-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_pipegeo_v16.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 11.10.2013
- **
- ** The beam pipe is composed of carbon with a thickness of 0.5 mm. It is
- ** placed directly into the cave as mother volume.
- ** The pipe consists of a number of parts. Each part has a PCON
- ** shape. The beam pipe inside the RICH is part of the RICH geometry;
- ** the beam pipe geometry thus excludes the z range of the RICH in case
- ** the latter is present in the setup.
-  *****************************************************************************/
-
-// 2018.08.23 - DE - shorten the table length from 400 cm to 250 cm
-
-
-#include "TGeoManager.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-// -------------   Other global variables   -----------------------------------
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_platform_v18d()
-{
-
-  // -----   Define platform parts   ----------------------------------------------
-
-  /** For v18d (mCBM)   **/
-  TString geoTag = "v18d_mcbm";
-
-  //  Double_t platform_angle = 25.;  // rotation angle around y-axis
-  //  Double_t platform_angle =   19.;  // rotation angle around y-axis
-  Double_t platform_angle = 0.;  // rotation angle around y-axis
-  //  Double_t platX_offset   = -230.;  // offset to the right side along x-axis
-  Double_t platX_offset = 0.;  // offset to the right side along x-axis
-
-  Double_t sizeX = 80.0;   // table width
-  Double_t sizeY = 80.0;   // table height
-  Double_t sizeZ = 250.0;  // table length
-
-  //  Double_t endZ  = 450.0;  // ends at z = 450.0
-
-  //  /** For v16b (SIS 300)   **/
-  //  TString geoTag = "v16b";
-  //  Double_t sizeX = 725.0;  // symmetric in x
-  //  Double_t sizeY = 234.0;  // without rails
-  //  Double_t sizeZ = 455.0;  // long version
-  //  Double_t endZ  = 540.0;  // ends at z = 450.0
-
-  //  Double_t beamY = 570.0;  // nominal beam height
-  Double_t beamY = 200.0;  // nominal beam height
-  Double_t posX  = 0;
-  Double_t posY  = -beamY + sizeY / 2.;  // rest on the floor at -beamY
-  Double_t posZ  = +sizeZ / 2.;
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "platform_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "Platform geometry created with create_platform_v16.C" << std::endl << std::endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //  // ---> aluminium
-  //  FairGeoMedium* mAluminium      = geoMedia->getMedium("aluminium");
-  //  if ( ! mAluminium ) Fatal("Main", "FairMedium aluminium not found");
-  //  geoBuild->createMedium(mAluminium);
-  //  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  //  if ( ! aluminium ) Fatal("Main", "Medium aluminium not found");
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PLATFORMgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-  TString platformName = "platform_";
-  platformName += geoTag;
-  TGeoVolume* platform = new TGeoVolumeAssembly(platformName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create   ---------------------------------------------------------
-  TGeoBBox* platform_base  = new TGeoBBox("", sizeX / 2., sizeY / 2., sizeZ / 2.);
-  TGeoVolume* platform_vol = new TGeoVolume("platform", platform_base, air);
-  platform_vol->SetLineColor(kBlue);
-  platform_vol->SetTransparency(70);
-
-  TGeoTranslation* platform_trans = new TGeoTranslation("", posX, posY, posZ);
-  platform->AddNode(platform_vol, 1, platform_trans);
-
-  infoFile << "sizeX: " << setprecision(2) << sizeX << "sizeY: " << setprecision(2) << sizeY
-           << "sizeZ: " << setprecision(2) << sizeZ << endl;
-  infoFile << "posX : " << setprecision(2) << posX << "posY : " << setprecision(2) << posY
-           << "posZ : " << setprecision(2) << posZ << endl;
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(platform, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  platform->Export(geoFileName);  // an alternative way of writing the platform volume
-
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-
-  // rotate the platform around y
-  TGeoRotation* platform_rotation = new TGeoRotation();
-  platform_rotation->RotateY(platform_angle);
-  //  TGeoCombiTrans* platform_placement = new TGeoCombiTrans( sin( platform_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., platform_rotation);
-  TGeoCombiTrans* platform_placement = new TGeoCombiTrans("platform_rot", platX_offset, 0., 0, platform_rotation);
-
-
-  //  TGeoTranslation* platform_placement = new TGeoTranslation("platform_trans", 0., 0., 0.);
-  platform_placement->Write();
-  geoFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18b.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18b.C
deleted file mode 100644
index 985a1d8c93..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18b.C
+++ /dev/null
@@ -1,395 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18b.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion = "v18b";
-const TString geoVersion = "much_" + tagVersion;
-//const TString subVersion   = "_3oclock";
-//const TString geoVersion   = "much_" + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR        = 2.5;  // Spacer width in R [cm]
-Double_t fSpacerPhi      = 2.5;  // Spacer width in Phi [cm]
-Double_t fOverlapR       = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-Double_t fStationZ0 = 80;
-Int_t fNlayers      = 3;    // Number of layers
-Double_t fLayersDz  = 10;   // distance between the layers
-Double_t fCoolLz    = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18b()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("Station");
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-  //  const TString tagVersion  = "mcbm";
-  //  const TString subVersion  = "_3oclock";
-  //  const TString geoVersion  = "much_" + tagVersion + subVersion;
-  //  const TString FileNameSim = geoVersion + ".geo.root";
-  //  const TString FileNameGeo  = geoVersion + "_geo.root";
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t DeltaR = 97.5;  // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  Double_t rmax = rmin + fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  Double_t ymin = rmin + fSpacerR;
-
-  Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-  Double_t dy  = (ymax - ymin) / 2.;                                      //y (length)
-  Double_t dx1 = ymin * TMath::Tan(phi0) + fOverlapR / TMath::Cos(phi0);  // large x
-  Double_t dx2 = ymax * TMath::Tan(phi0) + fOverlapR / TMath::Cos(phi0);  // small x
-  Double_t dz  = fActiveLzSector / 2.;                                    // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy  = dy + fSpacerR;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions
-  Double_t dy_s  = dy + 2.0;
-  Double_t dx1_s = dx1 + 2.0;     // large x
-  Double_t dx2_s = dx2 + 2.0;     // x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position oof the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    Double_t phi = TMath::Pi() / 2.0;
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    pos[0] = -(ymin + dy) * sin(phi);
-    pos[1] = (ymin + dy) * cos(phi);
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    r2->RotateZ(angle);
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-
-    // cout<<rmin<<"  "<<rmax<<"  "<<pos[1]<<"  "<<phi<<"  "<<fActiveLzSector<<"   "<<stGlobalZ0<<"  "<<istn<<"  "<<ily<<pos[0]<<endl;
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18c.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18c.C
deleted file mode 100644
index 7c364ac7d6..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18c.C
+++ /dev/null
@@ -1,407 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18c.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion = "v18c";
-const TString geoVersion = "much_" + tagVersion;
-//const TString subVersion   = "_3oclock";
-//const TString geoVersion   = "much_" + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR        = 2.5;  // Spacer width in R [cm]
-Double_t fSpacerPhi      = 2.5;  // Spacer width in Phi [cm]
-Double_t fOverlapR       = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-//Double_t fStationZ0=80;
-Double_t fStationZ0 = 70;   // DE - move 10 cm upstream
-Int_t fNlayers      = 3;    // Number of layers
-Double_t fLayersDz  = 10;   // distance between the layers
-Double_t fCoolLz    = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18c()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("Station");
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-  //  const TString tagVersion  = "mcbm";
-  //  const TString subVersion  = "_3oclock";
-  //  const TString geoVersion  = "much_" + tagVersion + subVersion;
-  //  const TString FileNameSim = geoVersion + ".geo.root";
-  //  const TString FileNameGeo  = geoVersion + "_geo.root";
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t DeltaR = 97.5;  // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  Double_t rmax = rmin + fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  Double_t ymin = rmin + fSpacerR;
-
-  Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-  Double_t dy  = (ymax - ymin) / 2.;                                      //y (length)
-  Double_t dx1 = ymin * TMath::Tan(phi0) + fOverlapR / TMath::Cos(phi0);  // large x
-  Double_t dx2 = ymax * TMath::Tan(phi0) + fOverlapR / TMath::Cos(phi0);  // small x
-  Double_t dz  = fActiveLzSector / 2.;                                    // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy  = dy + fSpacerR;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions
-  Double_t dy_s  = dy + 2.0;
-  Double_t dx1_s = dx1 + 2.0;     // large x
-  Double_t dx2_s = dx2 + 2.0;     // x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    Double_t phi = TMath::Pi() / 2.0;
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    r2->RotateZ(180.0);  // DE - 6 o'clock position
-    //      r2->RotateZ(180.0-(180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-
-    // cout<<rmin<<"  "<<rmax<<"  "<<pos[1]<<"  "<<phi<<"  "<<fActiveLzSector<<"   "<<stGlobalZ0<<"  "<<istn<<"  "<<ily<<pos[0]<<endl;
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18d.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18d.C
deleted file mode 100644
index 20fd9f72ff..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18d.C
+++ /dev/null
@@ -1,407 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18d.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion = "v18d";
-const TString geoVersion = "much_" + tagVersion;
-//const TString subVersion   = "_3oclock";
-//const TString geoVersion   = "much_" + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR        = 2.5;  // Spacer width in R [cm]
-Double_t fSpacerPhi      = 2.5;  // Spacer width in Phi [cm]
-Double_t fOverlapR       = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-//Double_t fStationZ0=80;
-Double_t fStationZ0 = 70;   // DE - move 10 cm upstream
-Int_t fNlayers      = 3;    // Number of layers
-Double_t fLayersDz  = 10;   // distance between the layers
-Double_t fCoolLz    = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18d()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("Station");
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-  //  const TString tagVersion  = "mcbm";
-  //  const TString subVersion  = "_3oclock";
-  //  const TString geoVersion  = "much_" + tagVersion + subVersion;
-  //  const TString FileNameSim = geoVersion + ".geo.root";
-  //  const TString FileNameGeo  = geoVersion + "_geo.root";
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t DeltaR = 97.5;  // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  Double_t rmax = rmin + fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  Double_t ymin = rmin + fSpacerR;
-
-  Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-  Double_t dy  = (ymax - ymin) / 2.;                                      //y (length)
-  Double_t dx1 = ymin * TMath::Tan(phi0) + fOverlapR / TMath::Cos(phi0);  // large x
-  Double_t dx2 = ymax * TMath::Tan(phi0) + fOverlapR / TMath::Cos(phi0);  // small x
-  Double_t dz  = fActiveLzSector / 2.;                                    // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy  = dy + fSpacerR;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions
-  Double_t dy_s  = dy + 2.0;
-  Double_t dx1_s = dx1 + 2.0;     // large x
-  Double_t dx2_s = dx2 + 2.0;     // x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    Double_t phi = TMath::Pi() / 2.0;
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    //      r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-
-    // cout<<rmin<<"  "<<rmax<<"  "<<pos[1]<<"  "<<phi<<"  "<<fActiveLzSector<<"   "<<stGlobalZ0<<"  "<<istn<<"  "<<ily<<pos[0]<<endl;
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18e.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18e.C
deleted file mode 100644
index 10905af6ca..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18e.C
+++ /dev/null
@@ -1,409 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18e.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-//2017-11-10 -- PPB -- corerct the y position of the moduels to genertae much points
-//2017-11-07 - PPB - change the shape of cooling plates from rectangular to sector
-//2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v18e";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-//Double_t fStationZ0=80;
-Double_t fStationZ0 = 70;   // DE - move 10 cm upstream
-Int_t fNlayers      = 3;    // Number of layers
-Double_t fLayersDz  = 10;   // distance between the layers
-Double_t fCoolLz    = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18e()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    Double_t phi = TMath::Pi() / 2.0;
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;  // DE - do not displace mMUCH in x
-    pos[1] = 0;  //15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18e1.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18e1.C
deleted file mode 100644
index 8a2d880eb2..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18e1.C
+++ /dev/null
@@ -1,411 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18e.C
-/// \brief Generates MUCH geometry in Root format.
-///
-// 2017-11-06 - PPB, VS and AM - v18e - mMUCH version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion = "_v18e";
-const TString geoVersion = "much";
-//const TString subVersion   = "_3oclock";
-//const TString geoVersion   = "much_" + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-//Double_t fStationZ0=80;
-Double_t fStationZ0 = 70;   // DE - move 10 cm upstream
-Int_t fNlayers      = 3;    // Number of layers
-Double_t fLayersDz  = 10;   // distance between the layers
-Double_t fCoolLz    = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18e()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-  //  const TString tagVersion  = "mcbm";
-  //  const TString subVersion  = "_3oclock";
-  //  const TString geoVersion  = "much_" + tagVersion + subVersion;
-  //  const TString FileNameSim = geoVersion + ".geo.root";
-  //  const TString FileNameGeo  = geoVersion + "_geo.root";
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = 46.5;          //dy+2.0;
-  Double_t dx1_s = 27.0;          //dx1+2.0 ;// large x
-  Double_t dx2_s = 27.0;          //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    Double_t phi = TMath::Pi() / 2.0;
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    //      r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18f.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18f.C
deleted file mode 100644
index 569ce706a5..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18f.C
+++ /dev/null
@@ -1,412 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18f.C
-/// \brief Generates MUCH geometry in Root format.
-///
-// 2017-11-15 - DE  - v18f - shift mMUCH back to z = 70, 80 and 90 cm to avoid clash with mSTS box
-// 2017-11-06 - PPB, VS and AM - v18e - mMUCH version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - v18e - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion = "_v18f";
-const TString geoVersion = "much";
-//const TString subVersion   = "_3oclock";
-//const TString geoVersion   = "much_" + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-Double_t fStationZ0 = 80;
-//Double_t fStationZ0=70;   // DE - move 10 cm upstream
-Int_t fNlayers     = 3;    // Number of layers
-Double_t fLayersDz = 10;   // distance between the layers
-Double_t fCoolLz   = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18f()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-  //  const TString tagVersion  = "mcbm";
-  //  const TString subVersion  = "_3oclock";
-  //  const TString geoVersion  = "much_" + tagVersion + subVersion;
-  //  const TString FileNameSim = geoVersion + ".geo.root";
-  //  const TString FileNameGeo  = geoVersion + "_geo.root";
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = 46.5;          //dy+2.0;
-  Double_t dx1_s = 27.0;          //dx1+2.0 ;// large x
-  Double_t dx2_s = 27.0;          //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    Double_t phi = TMath::Pi() / 2.0;
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    //      r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18g.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18g.C
deleted file mode 100644
index 770a2b10ae..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18g.C
+++ /dev/null
@@ -1,411 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18g.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v18g";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-Double_t fStationZ0 = 80;
-//Double_t fStationZ0=70;   // DE - move 10 cm upstream
-Int_t fNlayers     = 3;    // Number of layers
-Double_t fLayersDz = 10;   // distance between the layers
-Double_t fCoolLz   = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18g()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18h.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18h.C
deleted file mode 100644
index 1dddae97c0..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18h.C
+++ /dev/null
@@ -1,484 +0,0 @@
-/* Copyright (C) 2018 Department of Physics, Aligarh Muslim University, Aligarh
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh [committer] */
-
-//
-/// \file create_MUCH_geometry_v18h.C
-/// \brief Generates MUCH geometry in Root format.
-///
-// 2018-05-11 - OS & PPB & AJ- v18h - Add additional material(Drift and G10)
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v18h";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-const TString g10                 = "G10";        //G10 Plate
-const TString copper              = "copper";     //Drift
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-Double_t fStationZ0 = 80;
-//Double_t fStationZ0=70;   // DE - move 10 cm upstream
-Int_t fNlayers     = 3;       // Number of layers
-Double_t fLayersDz = 10;      // distance between the layers
-Double_t fCoolLz   = 1.0;     // thickness of the cooling plate also used as support
-Double_t fDriftDz  = 0.0035;  //35 micron copper Drift & Readout
-Double_t fG10Dz    = 0.3;     // 3 mm G10
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18h()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName  = geoVersion + tagVersion;
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);  //G10
-  geoBuild->createMedium(g10plate);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);  //Copper for Drift
-  geoBuild->createMedium(copperplate);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm) + Drift and G10
-  Double_t dy_s  = sdy2;           //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;           //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;           //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;   //
-  Double_t dz_sD = fDriftDz / 2.;  //35 micron copper Drift & Readout
-  Double_t dz_sG = fG10Dz / 2.;    // 3 mm G10
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium   = gGeoMan->GetMedium(coolmedium);    // cool medium
-    TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-    TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-
-
-    //Front G10 and copper Drift
-    TGeoTrap* frontG10 = new TGeoTrap(dz_sG, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    frontG10->SetName(Form("shStation%02iLayer%i%cModule%03ifront", istn, ily, cside, iModule));
-
-    TString fG10Name   = Form("muchstation%02ilayer%i%cfront%03iG10", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* vofG10 = new TGeoVolume(fG10Name, frontG10, g10plate);
-    vofG10->SetLineColor(28);
-
-
-    TGeoTrap* frontDrift = new TGeoTrap(dz_sD, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    frontDrift->SetName(Form("shStation%02iLayer%i%cModule%03ifront", istn, ily, cside, iModule));
-
-    TString fDriftName   = Form("muchstation%02ilayer%i%ccopper%03iDrift", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* vofDrift = new TGeoVolume(fDriftName, frontDrift, copperplate);
-    vofDrift->SetLineColor(kRed);
-
-
-    //Back G10 and copper Readout
-    TGeoTrap* backG10 = new TGeoTrap(dz_sG, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    backG10->SetName(Form("shStation%02iLayer%i%cModule%03iback", istn, ily, cside, iModule));
-
-    TString bG10Name   = Form("muchstation%02ilayer%i%cback%03iG10", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* vobG10 = new TGeoVolume(bG10Name, backG10, g10plate);
-    vobG10->SetLineColor(28);
-
-
-    TGeoTrap* backDrift = new TGeoTrap(dz_sD, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    backDrift->SetName(Form("shStation%02iLayer%i%cModule%03iback", istn, ily, cside, iModule));
-
-    TString bDriftName   = Form("muchstation%02ilayer%i%ccooper%03iReadout", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* vobDrift = new TGeoVolume(bDriftName, backDrift, copperplate);
-    vobDrift->SetLineColor(kRed);
-
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    Double_t RMin = (pos[1] / TMath::Cos(phi)) - dy;
-    Double_t RMax = 2 * dy + RMin;
-
-
-    //   cout<<"posY   "<<pos[1]<<endl;
-    //   cout<<"RMin  "<<RMin<<"   RMax  "<<RMax<<endl;
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1],
-                                                  pos[2] + dz + 2 * dz_sD + 2 * dz_sG + dz_s);  //Aluminum plate
-
-    TGeoTranslation* transfG10 = new TGeoTranslation("", pos[0], pos[1], pos[2] - dz - 2 * dz_sD - dz_sG);  //Front G10
-    TGeoTranslation* transfDrift = new TGeoTranslation("", pos[0], pos[1], pos[2] - dz - dz_sD);  //Front copper Drift
-    TGeoTranslation* transbG10   = new TGeoTranslation("", pos[0], pos[1], pos[2] + dz + 2 * dz_sD + dz_sG);  //Back G10
-    TGeoTranslation* transbDrift = new TGeoTranslation("", pos[0], pos[1], pos[2] + dz + dz_sD);  //Back copper Readout
-
-    //cout<<"FrontG10: "<<pos[2]-dz-2*dz_sD-dz_sG<<" FrontCopper: "<<pos[2]-dz-dz_sD<<" Active: "<<pos[2]<<" BackCopper: "<<pos[2]+dz+dz_sD<<" BackG10: "<<pos[2]+dz+2*dz_sD+dz_sG<<" Alumi: "<<pos[2]+dz+2*dz_sD+2*dz_sG+dz_s<<endl;
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");  // for cooling
-    (*incline_mod1)           = (*trans3) * (*r2);
-    volayer->AddNode(voCool, iModule, incline_mod1);
-
-
-    TGeoHMatrix* incline_mod2 = new TGeoHMatrix("");  // front G10
-    (*incline_mod2)           = (*transfG10) * (*r2);
-    volayer->AddNode(vofG10, iModule, incline_mod2);
-
-    TGeoHMatrix* incline_mod3 = new TGeoHMatrix("");  // front copper Drift
-    (*incline_mod3)           = (*transfDrift) * (*r2);
-    volayer->AddNode(vofDrift, iModule, incline_mod3);
-
-    TGeoHMatrix* incline_mod4 = new TGeoHMatrix("");  // Back G10
-    (*incline_mod4)           = (*transbG10) * (*r2);
-    volayer->AddNode(vobG10, iModule, incline_mod4);
-
-    TGeoHMatrix* incline_mod5 = new TGeoHMatrix("");  // Back copper Readout
-    (*incline_mod5)           = (*transbDrift) * (*r2);
-    volayer->AddNode(vobDrift, iModule, incline_mod5);
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18i.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18i.C
deleted file mode 100644
index 0bb6abd5f2..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18i.C
+++ /dev/null
@@ -1,413 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18i.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2018-08-28 - DE  - v18i - build a mMUCH with 2 GEM modules at z = 70 and 95 cm
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v18i";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-Double_t fStationZ0 = 95;
-//Double_t fStationZ0=70;   // DE - move 10 cm upstream
-Int_t fNlayers     = 3;    // Number of layers
-Double_t fLayersDz = 25;   // distance between the layers
-Double_t fCoolLz   = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18i()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    if (ii != 2)  // DE - skip 3rd=last GEM module for 2018
-      station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v18j.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v18j.C
deleted file mode 100644
index 66fdcf154a..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v18j.C
+++ /dev/null
@@ -1,414 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v18j.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2018-09-06 - DE  - v18j - reposition mMUCH at z=199 cm for cosmic setup 2018
-// 2018-08-28 - DE  - v18i - build a mMUCH with 2 GEM modules at z = 70 and 95 cm
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v18j";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-Double_t fStationZ0 = 234;
-//Double_t fStationZ0=70;   // DE - move 10 cm upstream
-Int_t fNlayers     = 3;    // Number of layers
-Double_t fLayersDz = 25;   // distance between the layers
-Double_t fCoolLz   = 1.0;  // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v18j()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TGeoVolume* much = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    if (ii != 2)  // DE - skip 3rd=last GEM module for 2018
-      station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 0;   // DE - do not displace mMUCH in x
-    pos[1] = 15;  // DE - move upwards in y [cm]
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v19a_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v19a_mcbm.C
deleted file mode 100644
index 158c7e0a2c..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v19a_mcbm.C
+++ /dev/null
@@ -1,415 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-//
-/// \file create_MUCH_geometry_v19a.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2019-07-05 - Ajit+Apar+OS  - v19a - build a mMUCH with 2 GEM modules at z = 84 and 106.5 cm : march setup
-// 2018-08-28 - DE  - v18i - build a mMUCH with 2 GEM modules at z = 70 and 95 cm
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v19a";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-Double_t fStationZ0 = 106.5;
-//Double_t fStationZ0=70;   // DE - move 10 cm upstream
-Int_t fNlayers     = 3;     // Number of layers
-Double_t fLayersDz = 22.5;  // distance between the layers
-Double_t fCoolLz   = 1.0;   // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v19a_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TString top_volume_name = geoVersion + tagVersion + "_mcbm";
-  TGeoVolume* much        = new TGeoVolumeAssembly(top_volume_name);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    if (ii != 2)  // DE - skip 3rd=last GEM module for 2018
-      station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 7.20;   // AJ + Apar -> As per March 2019 setup
-    pos[1] = 24.53;  // AJ + Apar -> As per March 2019 setup
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v19b_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v19b_mcbm.C
deleted file mode 100644
index 3142db11ce..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v19b_mcbm.C
+++ /dev/null
@@ -1,416 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-//
-/// \file create_MUCH_geometry_v19b.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2019-10-14 - DE  - v19b - move 20 downstream to make space for mRICH between mSTS and mMUCH
-// 2019-07-05 - Ajit+Apar+OS  - v19a - build a mMUCH with 2 GEM modules at z = 84 and 106.5 cm : march setup
-// 2018-08-28 - DE  - v18i - build a mMUCH with 2 GEM modules at z = 70 and 95 cm
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v19b";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-//Double_t fStationZ0=106.5;
-Double_t fStationZ0 = 126.5;  // DE - move 20 cm downstream
-Int_t fNlayers      = 3;      // Number of layers
-Double_t fLayersDz  = 22.5;   // distance between the layers
-Double_t fCoolLz    = 1.0;    // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v19b_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TString top_volume_name = geoVersion + tagVersion + "_mcbm";
-  TGeoVolume* much        = new TGeoVolumeAssembly(top_volume_name);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    if (ii != 2)  // DE - skip 3rd=last GEM module for 2018
-      station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 7.20;   // AJ + Apar -> As per March 2019 setup
-    pos[1] = 24.53;  // AJ + Apar -> As per March 2019 setup
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v19c_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v19c_mcbm.C
deleted file mode 100644
index 8ffe79dc63..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v19c_mcbm.C
+++ /dev/null
@@ -1,422 +0,0 @@
-/* Copyright (C) 2019-2020 Department of Physics, Banaras Hindu University, Varanasi
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Ajay Kumar [committer] */
-
-//
-/// \file create_MUCH_geometry_v19b.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2019-12-04 - Ajit  - v19c - build a mMUCH with 2 GEM modules at z = 90.5 and 122.5 cm : 27Nov19 setup
-// 2019-10-14 - DE  - v19b - move 20 downstream to make space for mRICH between mSTS and mMUCH
-// 2019-07-05 - Ajit+Apar+OS  - v19a - build a mMUCH with 2 GEM modules at z = 84 and 106.5 cm : march setup
-// 2018-08-28 - DE  - v18i - build a mMUCH with 2 GEM modules at z = 70 and 95 cm
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v19c";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-//Double_t fStationZ0=106.5;
-Double_t fStationZ0 = 122.5;  // DE - move 20 cm downstream
-Int_t fNlayers      = 3;      // Number of layers
-Double_t fLayersDz  = 32.0;   // distance between the layers
-Double_t fCoolLz    = 1.0;    // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v19c_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TString top_volume_name = geoVersion + tagVersion + "_mcbm";
-  TGeoVolume* much        = new TGeoVolumeAssembly(top_volume_name);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-
-  gGeoMan->CheckOverlaps(0.000001, "s");
-  gGeoMan->PrintOverlaps();
-
-
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    if (ii != 2)  // DE - skip 3rd=last GEM module for 2018
-      station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 10.10;  // AJ -> As per November 2019 setup
-    pos[1] = 24.53;  // AJ -> As per November 2019 setup
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v19d_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v19d_mcbm.C
deleted file mode 100644
index 82cddfd450..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v19d_mcbm.C
+++ /dev/null
@@ -1,422 +0,0 @@
-/* Copyright (C) 2020 Department of Physics, Banaras Hindu University, Varanasi
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Ajay Kumar [committer] */
-
-//
-/// \file create_MUCH_geometry_v19d.C
-/// \brief Generates MUCH geometry in Root format.
-///
-
-// 2020-01-15 - Ajit  - v19d - mMUCH with 2 GEM modules at z = 90.5 and 122.5 cm : Dec19 setup
-// 2019-12-04 - Ajit  - v19c - build a mMUCH with 2 GEM modules at z = 90.5 and 122.5 cm : 27Nov19 setup
-// 2019-10-14 - DE  - v19b - move 20 downstream to make space for mRICH between mSTS and mMUCH
-// 2019-07-05 - Ajit+Apar+OS  - v19a - build a mMUCH with 2 GEM modules at z = 84 and 106.5 cm : march setup
-// 2018-08-28 - DE  - v18i - build a mMUCH with 2 GEM modules at z = 70 and 95 cm
-// 2017-11-20 - DE  - v18g - shift back to z = 70, 80 and 90 cm to avoid mSTS box
-// 2017-11-10 - PPB -      - correct the y position of the modules to generate much points
-// 2017-11-07 - PPB -      - change the shape of cooling plates from rectangular to sector
-// 2017-11-06 - PPB, VS and AM - mcbm version with actual Mv2 dimesions of the module
-// 2017-10-23 - DE  - mcbm - put mMUCH in 6 o'clock position on z axis, shift 15 cm up and to z = 60, 70 and 80 cm
-// 2017-09-04 - PPB - mcbm - preliminary version of mini much geometry
-// 2017-05-16 - DE  - v17b - position the modules in a way to split layers left-right along y axis
-// 2017-05-16 - DE  - v17b - attribute name to module frames
-// 2017-05-16 - DE  - v17b - remove rim from support CompositeShape
-// 2017-05-02 - PPB - v17a - Change the shape of the first absorber according to latest design
-// 2017-04-27 - DE  - v17a - fix GEM module positions and angles
-// 2017-04-22 - PPB - v17a - Define the absorber, shield and station shapes sizes ...
-// 2016-04-19 - DE  - v17a - initial version derived from TRD
-
-// in root all sizes are given in cm
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-// Name of output file with geometry
-const TString tagVersion   = "_v19d";
-const TString geoVersion   = "much";
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString L                   = "MUCHlead";
-const TString W                   = "MUCHwolfram";
-const TString C                   = "MUCHcarbon";
-const TString I                   = "MUCHiron";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString coolmedium          = "aluminium";  //Al cooling plates
-
-
-// Universal input parameters
-
-// The inner angle is 11 degree (polar angle); We take z = 70 cm;
-//Inner radius: R_in=z*tan(theta_min) cm
-// Outer angle is decided from tan(theta_max)=R_out/z
-// R_out=R_in+95 cm (transverse size of the M2 module)
-
-
-Double_t fMuchZ1           = 0.0;   // MuchCave Zin position [cm]
-Double_t fAcceptanceTanMin = 0.19;  // Acceptance tangent min (11 degree)
-
-//************************************************************
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-                       // Sector-type module parameters
-// Number of sectors per layer (should be even for symmetry)
-// Needs to be fixed with actual numbers
-
-Double_t fActiveLzSector = 0.3;  // Active volume thickness [cm]
-Double_t fSpacerR1       = 2.8;  // Spacer width in R at low Z[cm]
-Double_t fSpacerR2       = 3.5;  // Spacer width in R at high Z[cm]
-
-Double_t fSpacerPhi = 2.8;  // Spacer width in Phi [cm]
-Double_t fOverlapR  = 0.0;  // Overlap in R direction [cm]
-
-// Station Zceneter [cm] in  the cave reference frame
-
-//Double_t fStationZ0=106.5;
-Double_t fStationZ0 = 120;   // DE - move 20 cm downstream
-Int_t fNlayers      = 3;     // Number of layers
-Double_t fLayersDz  = 32.0;  // distance between the layers
-Double_t fCoolLz    = 1.0;   // thickness of the cooling plate also used as support
-
-/* 
-   1 - detailed design (modules at two sides)
-   * 0 - simple design (1 module per layer) 
- */
-
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-void create_MUCH_geometry_v19d_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-
-  TString top_volume_name = geoVersion + tagVersion + "_mcbm";
-  TGeoVolume* much        = new TGeoVolumeAssembly(top_volume_name);
-  top->AddNode(much, 1);
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");  //change name from Station ->station
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {  // 1 Station
-
-    gModules_station[istn] = CreateStations(istn);
-
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-
-  gGeoMan->CheckOverlaps(0.000001);
-  gGeoMan->PrintOverlaps();
-
-  gGeoMan->CheckOverlaps(0.000001, "s");
-  gGeoMan->PrintOverlaps();
-  //  gGeoMan->Test();
-
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", 0., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHiron = geoMedia->getMedium(I);
-  geoBuild->createMedium(MUCHiron);
-
-  FairGeoMedium* MUCHlead = geoMedia->getMedium(L);
-  geoBuild->createMedium(MUCHlead);
-
-  FairGeoMedium* MUCHwolfram = geoMedia->getMedium(W);
-  geoBuild->createMedium(MUCHwolfram);
-
-  FairGeoMedium* MUCHcarbon = geoMedia->getMedium(C);
-  geoBuild->createMedium(MUCHcarbon);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* aluminium = geoMedia->getMedium(coolmedium);
-  // geoBuild->createMedium(MUCHcool);
-  geoBuild->createMedium(aluminium);
-}
-
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName = Form("muchstation%02i", ist + 1);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-
-  TGeoVolume* gLayer[4];
-
-  for (int ii = 0; ii < 3; ii++) {  // 3 Layers
-
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    if (ii != 2)  // DE - skip 3rd=last GEM module for 2018
-      station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName           = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  //Double_t DeltaR=80.0; // transverse dimension of the module
-
-  Double_t stGlobalZ0 = fStationZ0 + fMuchZ1;  //z position of station center (midplane) [cm]
-  Double_t stDz       = ((fNlayers - 1) * fLayersDz + fCoolLz + 2 * fActiveLzSector) / 2.;
-  Double_t stGlobalZ2 = stGlobalZ0 + stDz;
-  Double_t stGlobalZ1 = stGlobalZ0 - stDz;
-
-  //Double_t rmin = stGlobalZ1 * fAcceptanceTanMin;
-  // Double_t rmax = rmin+ fSpacerR + DeltaR;
-
-  Int_t Nsector = 16.0;  // need to be hard coded to match with station 1 of SIS100
-
-  //cout<<" Nsector "<<Nsector<<endl;
-
-  Double_t layerZ0       = (ily - (fNlayers - 1) / 2.) * fLayersDz;
-  Double_t layerGlobalZ0 = layerZ0 + stGlobalZ0;
-  Double_t sideDz        = fCoolLz / 2. + fActiveLzSector / 2.;  // distance between side's and layer's centers
-
-
-  Double_t moduleZ = sideDz;  // Z position of the module center in the layer cs
-
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-  //Double_t ymin = rmin+fSpacerR;
-
-  // Double_t ymax = rmax;
-
-  //define the dimensions of the trapezoidal module
-
-  //Use hard coded values for mini-cbm
-  Double_t dy = 40.0;  //(ymax-ymin)/2.; //y (length)
-
-  Double_t dx1 = 3.75;                  //ymin*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0);  // large x
-  Double_t dx2 = 20;                    //ymax*TMath::Tan(phi0)+fOverlapR/TMath::Cos(phi0); // small x
-  Double_t dz  = fActiveLzSector / 2.;  // thickness
-
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = dz - 0.1;
-
-
-  // Define the (cooling plate) diemnsions (hardcoded for mcbm)
-  Double_t dy_s  = sdy2;          //46.5;//dy+2.0;
-  Double_t dx1_s = sdx1;          //27.0;  //dx1+2.0 ;// large x
-  Double_t dx2_s = sdx2;          //27.0;  //dx2+2.0;// x
-  Double_t dz_s  = fCoolLz / 2.;  //
-
-
-  TVector3 pos;
-  TVector3 size = TVector3(0.0, 0.0, fActiveLzSector);
-
-
-  // Now start adding the GEM modules
-
-  for (Int_t iModule = 0; iModule < 1; iModule++) {
-    // if (iModule!=0) continue;
-    //    Double_t phi  = 2 * phi0 * (iModule + 0.5);  // add 0.5 to not overlap with y-axis for left-right layer separation
-
-    // Position of the module will depend on Phi
-    // Set Phi=180 degree 6 o'clock position
-    // Set Phi=90 degree 3 o'clock position
-
-    //    Double_t phi=TMath::Pi()/2.0;
-    Double_t phi = 0;  // do not blow up yMin in CbmMuchGeoScheme to see points
-
-    Bool_t isBack = iModule % 2;
-    Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-    // correct the x, y positions
-    //      pos[0] = -(ymin+dy)*sin(phi);
-    //      pos[1] =  (ymin+dy)*cos(phi);
-    pos[0] = 10.10;  // AJ -> As per November 2019 setup
-    pos[1] = 24.53;  // AJ -> As per November 2019 setup
-
-    // different z positions for odd/even modules
-    //  pos[2] = (isBack ? 1 : -1)*moduleZ + layerGlobalZ0;
-    pos[2] = layerGlobalZ0;
-
-    TGeoMedium* argon     = gGeoMan->GetMedium(activemedium);  // active medium
-    TGeoMedium* noryl     = gGeoMan->GetMedium(spacermedium);  // spacer medium
-    TGeoMedium* aluminium = gGeoMan->GetMedium(coolmedium);    // cool medium
-
-    // Define and place the trapezoidal GEM module in X-Y plane
-    TGeoTrap* shape = new TGeoTrap(dz, 0, phi, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-
-    // TGeoTrap* shape = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-
-
-    shape->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-    TString activeName   = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voActive = new TGeoVolume(activeName, shape, argon);
-    voActive->SetLineColor(kGreen);
-
-    // Define the trapezoidal spacers
-    TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, phi, sdy1, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-
-    //TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,0,sdy,sdx1,sdx2,0,sdy,sdx1,sdx2,0);
-
-    shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole", istn, ily, cside, iModule));
-    TString expression          = Form("shStation%02iLayer%i%cModule%03iFullFrameNoHole-"
-                              "shStation%02iLayer%i%cModule%03iActiveNoHole",
-                              istn, ily, cside, iModule, istn, ily, cside, iModule);
-    TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-      Form("shStation%02iLayer%i%cModule%03iFrameNoHole", istn, ily, cside, iModule), expression);
-    TString frameName   = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // add a name to the frame
-    voFrame->SetLineColor(kMagenta);
-
-
-    // Define the trapezoidal  (cooling plates)
-
-    // TGeoTrap* cool = new TGeoTrap(dz_s,0,phi,dy_s,dx1_s,dx2_s,0,dy_s,dx1_s,dx2_s,0);
-
-    TGeoTrap* cool = new TGeoTrap(dz_s, 0, phi, dy_s, dx1_s, dx2_s, 0, dy_s, dx1_s, dx2_s, 0);
-
-    cool->SetName(Form("shStation%02iLayer%i%cModule%03icool", istn, ily, cside, iModule));
-
-    TString CoolName   = Form("muchstation%02ilayer%i%ccool%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-    TGeoVolume* voCool = new TGeoVolume(CoolName, cool, aluminium);
-    voCool->SetLineColor(kYellow);
-
-
-    // Calculate the phi angle of the sector where it has to be placed
-    Double_t angle = 180. / TMath::Pi() * phi;  // convert angle phi from rad to deg
-
-    TGeoTranslation* trans2 = new TGeoTranslation("", pos[0], pos[1], pos[2]);  //for module and frame
-
-    TGeoTranslation* trans3 = new TGeoTranslation("", pos[0], pos[1], pos[2] + 0.65);  //for module and frame
-
-
-    TGeoRotation* r2 = new TGeoRotation("r2");
-    //rotate in the vertical plane (per to z axis) with angle
-    //      r2->RotateZ(angle);
-
-    // DE       cout << "DE " << phi << endl;
-    // DE       cout << "DE " << angle << endl;
-    // DE       cout << "DE " << phi0 << endl;
-    // DE       cout << "DE " << 180. / TMath::Pi() * phi0 << endl;
-
-    // r2->RotateZ(180.0);  // DE - 6 o'clock position
-    r2->RotateZ(180.0 - (180. / TMath::Pi() * phi0));  // DE - 6 o'clock position, left side vertical
-
-    // r2->RotateZ(180.0-11.25);  // DE - 6 o'clock position, left side vertical
-
-    // give rotation to set them in horizontal plane
-    //r2->RotateZ(90.0);//TMath::Pi());
-
-    TGeoHMatrix* incline_mod = new TGeoHMatrix("");
-
-    (*incline_mod) = (*trans2) * (*r2);  // OK
-
-    volayer->AddNode(voFrame, iModule, incline_mod);   // add frame
-    volayer->AddNode(voActive, iModule, incline_mod);  // add active volume
-
-    TGeoHMatrix* incline_mod1 = new TGeoHMatrix("");
-
-    (*incline_mod1) = (*trans3) * (*r2);  // for cooling
-
-    volayer->AddNode(voCool, iModule, incline_mod1);  // cooling plate
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v20a_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v20a_mcbm.C
deleted file mode 100644
index 2b578990ec..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v20a_mcbm.C
+++ /dev/null
@@ -1,453 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh, Florian Uhlig [committer] */
-
-/*** @author Omveer Singh <omvir.ch@gmail.com>
- ** @date 17 May 2020
- ** For more details see info file*/
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-TObjArray* fStations = new TObjArray();
-CbmMuchStation* muchSt;
-CbmMuchLayer* muchLy;
-CbmMuchLayerSide* muchLySd;
-
-// Name of output file with geometry
-const TString tagVersion = "_v20a";
-//const TString subVersion   = "_sis100_1m_lmvm";
-const TString geoVersion   = "much";  // + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-const TString FileNamePar  = geoVersion + tagVersion + "_mcbm.par.root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString Al                  = "aluminium";  //Al for cooling & support purpose
-const TString copper              = "copper";
-const TString g10                 = "G10";
-
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-
-Int_t fNlayers         = 2;               // Number of layers
-Double_t fLayersZ0[2]  = {85.7, 118.7};   // Layers Positions
-Int_t fDetType[2]      = {3, 3};          // Detector type
-Double_t fX[2]         = {7.2, 7.2};      //Placement of modules in X [cm]
-Double_t fY[2]         = {24.53, 24.53};  //Placement of modules in Y [cm]
-Double_t fSupportLz[2] = {1., 1.};        // (cooling + support)
-Double_t fDriftDz      = 0.0035;          //35 micron copper Drift
-Double_t fG10Dz        = 0.30;            // 3 mm G10
-
-Double_t fActiveLzSector[2] = {0.3, 0.3};  // Active volume thickness [cm]
-Double_t fFrameLzSector[2]  = {.3, .3};    // Frame thickness [cm]
-Double_t fSpacerPhi         = 2.0;         // Spacer width in Phi [cm]
-Double_t fOverlapR          = 2.0;         // Overlap in R direction [cm]
-Double_t fSpacerR1          = 2.8;         // Spacer width in R at low Z[cm]
-Double_t fSpacerR2          = 3.5;         // Spacer width in R at high Z[cm]
-
-//Size of Modules
-//GEM
-Double_t dy  = 40.0;
-Double_t dx1 = 3.75;
-Double_t dx2 = 20;
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-
-fstream infoFile;
-void create_MUCH_geometry_v20a_mcbm()
-{
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = FileNameSim;
-  infoFileName.ReplaceAll("root", "info");
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "MUCH geometry created with create_MUCH_geometry_v20a_mcbm.C" << endl << endl;
-  infoFile << "Build a mMUCH setup for mCBM with 2 GEM." << endl;
-  infoFile << "10 mm thick Al plates are used for support and cooling in the "
-              "GEM modules."
-           << endl;
-  infoFile << "Drift and read-out PCBs (copper coated G10 plates) inserted for "
-              "realistic material budget for both GEM and RPC modules."
-           << endl
-           << endl;
-  infoFile << "No of Modules: " << fNlayers << "      ( GEM )" << endl;
-  infoFile << "Position of Modules Z [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fLayersZ0[i] << "    ";
-
-  infoFile << endl << endl << "Placement of Modules:" << endl;
-  infoFile << "Module"
-           << "\t"
-           << "X [cm]"
-           << "\t"
-           << "Y [cm]"
-           << "\t" << endl;
-  infoFile << "----------------------" << endl;
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << " " << i + 1 << "\t" << fX[i] << "\t" << fY[i] << endl;
-  infoFile << "----------------------" << endl;
-  infoFile << endl << "Al Cooling Plate Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fSupportLz[i] << "    ";
-
-  infoFile << endl << "Active Volume Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fActiveLzSector[i] << "    ";
-
-  infoFile << endl << endl << endl << " GEM Module:" << endl;
-  infoFile << "                " << 2 * dx1 << " cm" << endl;
-  infoFile << "               .........                 |" << endl;
-  infoFile << "              ...........                |" << endl;
-  infoFile << "             .............               |" << endl;
-  infoFile << "            ...............              |" << endl;
-  infoFile << "           .................             |" << endl;
-  infoFile << "          ...................            |" << endl;
-  infoFile << "         .....................           |" << endl;
-  infoFile << "        .......................         " << 2 * dy << " cm" << endl;
-  infoFile << "       .........................         |" << endl;
-  infoFile << "      ...........................        |" << endl;
-  infoFile << "     .............................       |" << endl;
-  infoFile << "    ...............................      |" << endl;
-  infoFile << "   .................................     |" << endl;
-  infoFile << "  ...................................    |" << endl;
-  infoFile << " .....................................   |" << endl;
-  infoFile << ".......................................  |" << endl;
-  infoFile << "                " << 2 * dx2 << " cm" << endl;
-  infoFile << endl;
-
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName = geoVersion + tagVersion + "_mcbm";
-
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");
-  much->AddNode(sttn, 1);
-
-
-  for (Int_t istn = 0; istn < 1; istn++) {
-
-    Double_t stGlobalZ0 = (fLayersZ0[0] + fLayersZ0[1]) / 2.;
-    muchSt              = new CbmMuchStation(istn, stGlobalZ0);
-    muchSt->SetRmin(0.);
-    muchSt->SetRmax(0.);
-    fStations->Add(muchSt);
-
-
-    gModules_station[istn] = CreateStations(istn);
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", -6., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-  infoFile.close();
-
-  TFile* parfile = new TFile(FileNamePar, "RECREATE");
-  fStations->Write("stations", 1);  // for geometry parameters
-  parfile->Close();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* MUCHsupport = geoMedia->getMedium(Al);
-  geoBuild->createMedium(MUCHsupport);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);
-  geoBuild->createMedium(copperplate);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);
-  geoBuild->createMedium(g10plate);
-}
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName         = Form("muchstation%02i", ist + 1);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-  TGeoVolume* gLayer[fNlayers + 1];
-  for (int ii = 0; ii < fNlayers; ii++) {  // 2 Layers
-
-    Double_t sideDz = fSupportLz[ii] / 2. + fActiveLzSector[ii] / 2.;  // distance between side's and layer's centers
-
-    muchLy = new CbmMuchLayer(ist, ii, fLayersZ0[ii], 0.);
-    muchSt->AddLayer(muchLy);
-    muchLy->GetSideF()->SetZ(fLayersZ0[ii] - sideDz);
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[ily] / 2.;
-  Double_t driftDz   = fActiveLzSector[ily] / 2 + fDriftDz / 2.;
-  Double_t g10Dz     = driftDz + fDriftDz / 2. + fG10Dz / 2.;
-
-
-  Double_t moduleZ   = fLayersZ0[ily];
-  Double_t driftZIn  = moduleZ - driftDz;
-  Double_t driftZOut = moduleZ + driftDz;
-  Double_t g10ZIn    = moduleZ - g10Dz;
-  Double_t g10ZOut   = moduleZ + g10Dz;
-  Double_t cool_z    = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz = fActiveLzSector[ily] / 2.;  // Active Volume Thickness
-
-  Int_t Nsector = 16.0;
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = fFrameLzSector[ily] / 2.;
-
-  //define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz / 2.;  //35 micron copper Drift
-  Double_t dz_sG = fG10Dz / 2.;    // 3mm G10
-  Double_t sdy   = sdy2;
-
-
-  Double_t pos[10];
-
-  Int_t iMod = 0;
-  for (Int_t iSide = 0; iSide < 1; iSide++) {
-    muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the GEM modules
-    for (Int_t iModule = 0; iModule < 1; iModule++) {
-
-      Double_t phi  = 0;  // add 0.5 to not overlap with y-axis for left-right layer separation
-      Bool_t isBack = iModule % 2;
-      Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-      // correct the x, y positions
-      pos[0] = fX[ily];
-      pos[1] = fY[ily];
-
-
-      // different z positions for odd/even modules
-      pos[2] = moduleZ;
-      pos[3] = driftZIn;
-      pos[4] = driftZOut;
-      pos[5] = g10ZIn;
-      pos[6] = g10ZOut;
-      pos[7] = cool_z;
-
-      if (iSide != isBack) continue;
-      if (iModule != 0) iMod = iModule / 2;
-
-      muchLySd = muchLy->GetSide(iSide);
-
-      TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-      TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-      TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-      TGeoMedium* coolMat     = gGeoMan->GetMedium(Al);
-
-
-      // Define and place the shape of the modules
-      TGeoTrap* shapeGem = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeGem->SetName(Form("shStation%02iLayer%i%cModule%03iActiveGemNoHole", istn, ily, cside, iModule));
-
-      //------------------------------------------------------Al Cooling Plate--------------------------------------------------------------------
-      TGeoVolume* voActive;
-      TGeoTrap* coolGem;
-      TGeoVolume* voCool;
-
-      coolGem = new TGeoTrap(SupportDz, 0, phi, sdy2, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-      coolGem->SetName(Form("shStation%02iLayer%i%cModule%03icoolGem", istn, ily, cside, iModule));
-      TString CoolName = Form("muchstation%02ilayer%i%ccoolGem%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-      voCool           = new TGeoVolume(CoolName, coolGem, coolMat);
-      voCool->SetLineColor(kYellow);
-
-      //------------------------------------------------------Active Volume-----------------------------------------------------
-      //GEM
-      TGeoTrap* shapeActive = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-      TString activeName = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iMod + 1);
-      voActive           = new TGeoVolume(activeName, shapeActive, argon);
-      voActive->SetLineColor(kGreen);
-
-
-      //---------------------------------------------------------Drift & PCB's---------------------------------------------------------------
-
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftGem[2], *G10Gem[2];
-
-      for (int iPos = 0; iPos < 2; iPos++) {
-        Char_t cpos    = (iPos == 0) ? 'i' : 'o';
-        DriftGem[iPos] = new TGeoTrap(dz_sD, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        G10Gem[iPos]   = new TGeoTrap(dz_sG, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        DriftGem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule, cpos));
-        DriftName[iPos] =
-          Form("muchstation%02ilayer%i%cside%03i%ccopperDrift", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        G10Gem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule, cpos));
-        G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        voDrift[iPos] = new TGeoVolume(DriftName[iPos], DriftGem[iPos], copperplate);
-        voDrift[iPos]->SetLineColor(kRed);
-        voG10[iPos] = new TGeoVolume(G10Name[iPos], G10Gem[iPos], g10plate);
-        voG10[iPos]->SetLineColor(28);
-      }
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, 0, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-
-      TString expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%"
-                                "02iLayer%i%cModule%03iActiveGemNoHole",
-                                istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-        Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iMod + 1);
-
-      TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // Frame for GEM
-      voFrame->SetLineColor(kMagenta);
-
-
-      //----------------------------------------------------Placement----------------------------------------------------------------------
-      // Calculate the phi angle of the sector where it has to be placed
-      Double_t angle = 180.0 - (180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-
-      TGeoRotation* r2 = new TGeoRotation("r2");
-      //rotate in the vertical plane (per to z axis) with angle
-      r2->RotateZ(angle);
-
-
-      TGeoTranslation* trans[10];
-      TGeoHMatrix* incline_mod[10];
-
-      for (int i = 0; i < 6; i++) {
-        trans[i] = new TGeoTranslation("", pos[0], pos[1], pos[i + 2]);
-
-        incline_mod[i]    = new TGeoHMatrix("");
-        (*incline_mod[i]) = (*trans[i]) * (*r2);
-      }
-
-      volayer->AddNode(voFrame, iMod, incline_mod[0]);     // add spacer
-      volayer->AddNode(voActive, iMod, incline_mod[0]);    // add active volume
-      volayer->AddNode(voDrift[0], iMod, incline_mod[1]);  //Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[2]);  //Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[3]);    //G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[4]);    //G10 Out
-      volayer->AddNode(voCool, iMod, incline_mod[5]);      // Al Cooling Plate
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-      muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[ily], istn, ily, iSide, iModule, Position, 2 * dx1,
-                                                     2 * dx2, 2 * dy, 2 * dz, muchSt->GetRmin()));
-    }
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v22a_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v22a_mcbm.C
deleted file mode 100644
index f74875e240..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v22a_mcbm.C
+++ /dev/null
@@ -1,442 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh, Florian Uhlig [committer] */
-
-/*** @author Omveer Singh <omvir.ch@gmail.com>
- ** @date 17 May 2020
- ** For more details see info file*/
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-TObjArray* fStations = new TObjArray();
-CbmMuchStation* muchSt;
-CbmMuchLayer* muchLy;
-CbmMuchLayerSide* muchLySd;
-
-// Name of output file with geometry
-const TString tagVersion = "_v22a";
-// const TString subVersion   = "_sis100_1m_lmvm";
-const TString geoVersion   = "much";  // + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-const TString FileNamePar  = geoVersion + tagVersion + "_mcbm.par.root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString Al                  = "aluminium";  // Al for cooling & support purpose
-const TString copper              = "copper";
-const TString g10                 = "G10";
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-
-Int_t fNlayers        = 2;             // Number of layers
-Double_t fLayersZ0[2] = {65.7, 88.7};  // Layers Positions shifted  z axis old {65.7,118.7)
-// Double_t fLayersZ0[2]  = {85.7, 118.7};   // Layers Positions
-Int_t fDetType[2]      = {3, 3};          // Detector type
-Double_t fX[2]         = {7.2, 7.2};      // Placement of modules in X [cm]
-Double_t fY[2]         = {24.53, 24.53};  // Placement of modules in Y [cm]
-Double_t fSupportLz[2] = {1., 1.};        // (cooling + support)
-Double_t fDriftDz      = 0.0035;          // 35 micron copper Drift
-Double_t fG10Dz        = 0.30;            // 3 mm G10
-
-Double_t fActiveLzSector[2] = {0.3, 0.3};  // Active volume thickness [cm]
-Double_t fFrameLzSector[2]  = {.3, .3};    // Frame thickness [cm]
-Double_t fSpacerPhi         = 2.0;         // Spacer width in Phi [cm]
-Double_t fOverlapR          = 2.0;         // Overlap in R direction [cm]
-Double_t fSpacerR1          = 2.8;         // Spacer width in R at low Z[cm]
-Double_t fSpacerR2          = 3.5;         // Spacer width in R at high Z[cm]
-
-// Size of Modules
-// GEM
-Double_t dy  = 40.0;
-Double_t dx1 = 3.75;
-Double_t dx2 = 20;
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-fstream infoFile;
-void create_MUCH_geometry_v22a_mcbm()
-{
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = FileNameSim;
-  infoFileName.ReplaceAll("root", "info");
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "MUCH geometry created with create_MUCH_geometry_v20a_mcbm.C" << endl << endl;
-  infoFile << "Build a mMUCH setup for mCBM with 2 GEM." << endl;
-  infoFile << "10 mm thick Al plates are used for support and cooling in the "
-              "GEM modules."
-           << endl;
-  infoFile << "Drift and read-out PCBs (copper coated G10 plates) inserted for "
-              "realistic material budget for both GEM and RPC modules."
-           << endl
-           << endl;
-  infoFile << "No of Modules: " << fNlayers << "      ( GEM )" << endl;
-  infoFile << "Position of Modules Z [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fLayersZ0[i] << "    ";
-
-  infoFile << endl << endl << "Placement of Modules:" << endl;
-  infoFile << "Module"
-           << "\t"
-           << "X [cm]"
-           << "\t"
-           << "Y [cm]"
-           << "\t" << endl;
-  infoFile << "----------------------" << endl;
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << " " << i + 1 << "\t" << fX[i] << "\t" << fY[i] << endl;
-  infoFile << "----------------------" << endl;
-  infoFile << endl << "Al Cooling Plate Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fSupportLz[i] << "    ";
-
-  infoFile << endl << "Active Volume Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fActiveLzSector[i] << "    ";
-
-  infoFile << endl << endl << endl << " GEM Module:" << endl;
-  infoFile << "                " << 2 * dx1 << " cm" << endl;
-  infoFile << "               .........                 |" << endl;
-  infoFile << "              ...........                |" << endl;
-  infoFile << "             .............               |" << endl;
-  infoFile << "            ...............              |" << endl;
-  infoFile << "           .................             |" << endl;
-  infoFile << "          ...................            |" << endl;
-  infoFile << "         .....................           |" << endl;
-  infoFile << "        .......................         " << 2 * dy << " cm" << endl;
-  infoFile << "       .........................         |" << endl;
-  infoFile << "      ...........................        |" << endl;
-  infoFile << "     .............................       |" << endl;
-  infoFile << "    ...............................      |" << endl;
-  infoFile << "   .................................     |" << endl;
-  infoFile << "  ...................................    |" << endl;
-  infoFile << " .....................................   |" << endl;
-  infoFile << ".......................................  |" << endl;
-  infoFile << "                " << 2 * dx2 << " cm" << endl;
-  infoFile << endl;
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName = geoVersion + tagVersion + "_mcbm";
-
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {
-
-    Double_t stGlobalZ0 = (fLayersZ0[0] + fLayersZ0[1]) / 2.;
-    muchSt              = new CbmMuchStation(istn, stGlobalZ0);
-    muchSt->SetRmin(0.);
-    muchSt->SetRmax(0.);
-    fStations->Add(muchSt);
-
-    gModules_station[istn] = CreateStations(istn);
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", -6., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-  infoFile.close();
-
-  TFile* parfile = new TFile(FileNamePar, "RECREATE");
-  fStations->Write("stations", 1);  // for geometry parameters
-  parfile->Close();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already
-  // defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* MUCHsupport = geoMedia->getMedium(Al);
-  geoBuild->createMedium(MUCHsupport);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);
-  geoBuild->createMedium(copperplate);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);
-  geoBuild->createMedium(g10plate);
-}
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName         = Form("muchstation%02i", ist + 1);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-  TGeoVolume* gLayer[fNlayers + 1];
-  for (int ii = 0; ii < fNlayers; ii++) {  // 2 Layers
-
-    Double_t sideDz = fSupportLz[ii] / 2. + fActiveLzSector[ii] / 2.;  // distance between side's and layer's centers
-
-    muchLy = new CbmMuchLayer(ist, ii, fLayersZ0[ii], 0.);
-    muchSt->AddLayer(muchLy);
-    muchLy->GetSideF()->SetZ(fLayersZ0[ii] - sideDz);
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[ily] / 2.;
-  Double_t driftDz   = fActiveLzSector[ily] / 2 + fDriftDz / 2.;
-  Double_t g10Dz     = driftDz + fDriftDz / 2. + fG10Dz / 2.;
-
-  Double_t moduleZ   = fLayersZ0[ily];
-  Double_t driftZIn  = moduleZ - driftDz;
-  Double_t driftZOut = moduleZ + driftDz;
-  Double_t g10ZIn    = moduleZ - g10Dz;
-  Double_t g10ZOut   = moduleZ + g10Dz;
-  Double_t cool_z    = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz = fActiveLzSector[ily] / 2.;  // Active Volume Thickness
-
-  Int_t Nsector = 16.0;
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-
-  // define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = fFrameLzSector[ily] / 2.;
-
-  // define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz / 2.;  // 35 micron copper Drift
-  Double_t dz_sG = fG10Dz / 2.;    // 3mm G10
-  Double_t sdy   = sdy2;
-
-  Double_t pos[10];
-
-  Int_t iMod = 0;
-  for (Int_t iSide = 0; iSide < 1; iSide++) {
-    muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the GEM modules
-    for (Int_t iModule = 0; iModule < 1; iModule++) {
-
-      Double_t phi = 0;  // add 0.5 to not overlap with y-axis for left-right
-                         // layer separation
-      Bool_t isBack = iModule % 2;
-      Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-      // correct the x, y positions
-      pos[0] = fX[ily];
-      pos[1] = fY[ily];
-
-      // different z positions for odd/even modules
-      pos[2] = moduleZ;
-      pos[3] = driftZIn;
-      pos[4] = driftZOut;
-      pos[5] = g10ZIn;
-      pos[6] = g10ZOut;
-      pos[7] = cool_z;
-
-      if (iSide != isBack) continue;
-      if (iModule != 0) iMod = iModule / 2;
-
-      muchLySd = muchLy->GetSide(iSide);
-
-      TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-      TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-      TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-      TGeoMedium* coolMat     = gGeoMan->GetMedium(Al);
-
-      // Define and place the shape of the modules
-      TGeoTrap* shapeGem = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeGem->SetName(Form("shStation%02iLayer%i%cModule%03iActiveGemNoHole", istn, ily, cside, iModule));
-
-      //------------------------------------------------------Al Cooling
-      // Plate--------------------------------------------------------------------
-      TGeoVolume* voActive;
-      TGeoTrap* coolGem;
-      TGeoVolume* voCool;
-
-      coolGem = new TGeoTrap(SupportDz, 0, phi, sdy2, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-      coolGem->SetName(Form("shStation%02iLayer%i%cModule%03icoolGem", istn, ily, cside, iModule));
-      TString CoolName = Form("muchstation%02ilayer%i%ccoolGem%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-      voCool           = new TGeoVolume(CoolName, coolGem, coolMat);
-      voCool->SetLineColor(kYellow);
-
-      //------------------------------------------------------Active
-      // Volume-----------------------------------------------------
-      // GEM
-      TGeoTrap* shapeActive = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-      TString activeName = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iMod + 1);
-      voActive           = new TGeoVolume(activeName, shapeActive, argon);
-      voActive->SetLineColor(kGreen);
-
-      //---------------------------------------------------------Drift &
-      // PCB's---------------------------------------------------------------
-
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftGem[2], *G10Gem[2];
-
-      for (int iPos = 0; iPos < 2; iPos++) {
-        Char_t cpos    = (iPos == 0) ? 'i' : 'o';
-        DriftGem[iPos] = new TGeoTrap(dz_sD, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        G10Gem[iPos]   = new TGeoTrap(dz_sG, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        DriftGem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule, cpos));
-        DriftName[iPos] =
-          Form("muchstation%02ilayer%i%cside%03i%ccopperDrift", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        G10Gem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule, cpos));
-        G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        voDrift[iPos] = new TGeoVolume(DriftName[iPos], DriftGem[iPos], copperplate);
-        voDrift[iPos]->SetLineColor(kRed);
-        voG10[iPos] = new TGeoVolume(G10Name[iPos], G10Gem[iPos], g10plate);
-        voG10[iPos]->SetLineColor(28);
-      }
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, 0, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-      TString expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%"
-                                "02iLayer%i%cModule%03iActiveGemNoHole",
-                                istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-        Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iMod + 1);
-
-      TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // Frame for GEM
-      voFrame->SetLineColor(kMagenta);
-
-      //----------------------------------------------------Placement----------------------------------------------------------------------
-      // Calculate the phi angle of the sector where it has to be placed
-      Double_t angle = 180.0 - (180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-      TGeoRotation* r2 = new TGeoRotation("r2");
-      // rotate in the vertical plane (per to z axis) with angle
-      r2->RotateZ(angle);
-
-      TGeoTranslation* trans[10];
-      TGeoHMatrix* incline_mod[10];
-
-      for (int i = 0; i < 6; i++) {
-        trans[i] = new TGeoTranslation("", pos[0], pos[1], pos[i + 2]);
-
-        incline_mod[i]    = new TGeoHMatrix("");
-        (*incline_mod[i]) = (*trans[i]) * (*r2);
-      }
-
-      volayer->AddNode(voFrame, iMod, incline_mod[0]);     // add spacer
-      volayer->AddNode(voActive, iMod, incline_mod[0]);    // add active volume
-      volayer->AddNode(voDrift[0], iMod, incline_mod[1]);  // Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[2]);  // Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[3]);    // G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[4]);    // G10 Out
-      volayer->AddNode(voCool, iMod, incline_mod[5]);      // Al Cooling Plate
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-      muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[ily], istn, ily, iSide, iModule, Position, 2 * dx1,
-                                                     2 * dx2, 2 * dy, 2 * dz, muchSt->GetRmin()));
-    }
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v22b_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v22b_mcbm.C
deleted file mode 100644
index a6ee1cff76..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v22b_mcbm.C
+++ /dev/null
@@ -1,442 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh, Florian Uhlig [committer] */
-
-/*** @author Omveer Singh <omvir.ch@gmail.com>
- ** @date 17 May 2020
- ** For more details see info file*/
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-TObjArray* fStations = new TObjArray();
-CbmMuchStation* muchSt;
-CbmMuchLayer* muchLy;
-CbmMuchLayerSide* muchLySd;
-
-// Name of output file with geometry
-const TString tagVersion = "_v22b";
-// const TString subVersion   = "_sis100_1m_lmvm";
-const TString geoVersion   = "much";  // + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-const TString FileNamePar  = geoVersion + tagVersion + "_mcbm.par.root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString Al                  = "aluminium";  // Al for cooling & support purpose
-const TString copper              = "copper";
-const TString g10                 = "G10";
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-
-Int_t fNlayers        = 2;              // Number of layers
-Double_t fLayersZ0[2] = {65.7, 118.7};  // Layers Positions
-// Double_t fLayersZ0[2]  = {85.7, 118.7};   // Layers Positions
-Int_t fDetType[2]      = {3, 3};          // Detector type
-Double_t fX[2]         = {7.2, 7.2};      // Placement of modules in X [cm]
-Double_t fY[2]         = {24.53, 24.53};  // Placement of modules in Y [cm]
-Double_t fSupportLz[2] = {1., 1.};        // (cooling + support)
-Double_t fDriftDz      = 0.0035;          // 35 micron copper Drift
-Double_t fG10Dz        = 0.30;            // 3 mm G10
-
-Double_t fActiveLzSector[2] = {0.3, 0.3};  // Active volume thickness [cm]
-Double_t fFrameLzSector[2]  = {.3, .3};    // Frame thickness [cm]
-Double_t fSpacerPhi         = 2.0;         // Spacer width in Phi [cm]
-Double_t fOverlapR          = 2.0;         // Overlap in R direction [cm]
-Double_t fSpacerR1          = 2.8;         // Spacer width in R at low Z[cm]
-Double_t fSpacerR2          = 3.5;         // Spacer width in R at high Z[cm]
-
-// Size of Modules
-// GEM
-Double_t dy  = 40.0;
-Double_t dx1 = 3.75;
-Double_t dx2 = 20;
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-fstream infoFile;
-void create_MUCH_geometry_v22b_mcbm()
-{
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = FileNameSim;
-  infoFileName.ReplaceAll("root", "info");
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "MUCH geometry created with create_MUCH_geometry_v22b_mcbm.C" << endl << endl;
-  infoFile << "Build a mMUCH setup for mCBM with 1 GEM." << endl;
-  infoFile << "10 mm thick Al plates are used for support and cooling in the "
-              "GEM modules."
-           << endl;
-  infoFile << "Drift and read-out PCBs (copper coated G10 plates) inserted for "
-              "realistic material budget for both GEM and RPC modules."
-           << endl
-           << endl;
-  infoFile << "No of Modules: " << fNlayers << "      ( GEM )" << endl;
-  infoFile << "Position of Modules Z [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fLayersZ0[i] << "    ";
-
-  infoFile << endl << endl << "Placement of Modules:" << endl;
-  infoFile << "Module"
-           << "\t"
-           << "X [cm]"
-           << "\t"
-           << "Y [cm]"
-           << "\t" << endl;
-  infoFile << "----------------------" << endl;
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << " " << i + 1 << "\t" << fX[i] << "\t" << fY[i] << endl;
-  infoFile << "----------------------" << endl;
-  infoFile << endl << "Al Cooling Plate Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fSupportLz[i] << "    ";
-
-  infoFile << endl << "Active Volume Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fActiveLzSector[i] << "    ";
-
-  infoFile << endl << endl << endl << " GEM Module:" << endl;
-  infoFile << "                " << 2 * dx1 << " cm" << endl;
-  infoFile << "               .........                 |" << endl;
-  infoFile << "              ...........                |" << endl;
-  infoFile << "             .............               |" << endl;
-  infoFile << "            ...............              |" << endl;
-  infoFile << "           .................             |" << endl;
-  infoFile << "          ...................            |" << endl;
-  infoFile << "         .....................           |" << endl;
-  infoFile << "        .......................         " << 2 * dy << " cm" << endl;
-  infoFile << "       .........................         |" << endl;
-  infoFile << "      ...........................        |" << endl;
-  infoFile << "     .............................       |" << endl;
-  infoFile << "    ...............................      |" << endl;
-  infoFile << "   .................................     |" << endl;
-  infoFile << "  ...................................    |" << endl;
-  infoFile << " .....................................   |" << endl;
-  infoFile << ".......................................  |" << endl;
-  infoFile << "                " << 2 * dx2 << " cm" << endl;
-  infoFile << endl;
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName = geoVersion + tagVersion + "_mcbm";
-
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {
-
-    Double_t stGlobalZ0 = (fLayersZ0[0] + fLayersZ0[1]) / 2.;
-    muchSt              = new CbmMuchStation(istn, stGlobalZ0);
-    muchSt->SetRmin(0.);
-    muchSt->SetRmax(0.);
-    fStations->Add(muchSt);
-
-    gModules_station[istn] = CreateStations(istn);
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", -6., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-  infoFile.close();
-
-  TFile* parfile = new TFile(FileNamePar, "RECREATE");
-  fStations->Write("stations", 1);  // for geometry parameters
-  parfile->Close();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already
-  // defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* MUCHsupport = geoMedia->getMedium(Al);
-  geoBuild->createMedium(MUCHsupport);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);
-  geoBuild->createMedium(copperplate);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);
-  geoBuild->createMedium(g10plate);
-}
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName         = Form("muchstation%02i", ist + 1);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-  TGeoVolume* gLayer[fNlayers + 1];
-  for (int ii = 0; ii < 1; ii++) {  // 1 Layers
-
-    Double_t sideDz = fSupportLz[ii] / 2. + fActiveLzSector[ii] / 2.;  // distance between side's and layer's centers
-
-    muchLy = new CbmMuchLayer(ist, ii, fLayersZ0[ii], 0.);
-    muchSt->AddLayer(muchLy);
-    muchLy->GetSideF()->SetZ(fLayersZ0[ii] - sideDz);
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[ily] / 2.;
-  Double_t driftDz   = fActiveLzSector[ily] / 2 + fDriftDz / 2.;
-  Double_t g10Dz     = driftDz + fDriftDz / 2. + fG10Dz / 2.;
-
-  Double_t moduleZ   = fLayersZ0[ily];
-  Double_t driftZIn  = moduleZ - driftDz;
-  Double_t driftZOut = moduleZ + driftDz;
-  Double_t g10ZIn    = moduleZ - g10Dz;
-  Double_t g10ZOut   = moduleZ + g10Dz;
-  Double_t cool_z    = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz = fActiveLzSector[ily] / 2.;  // Active Volume Thickness
-
-  Int_t Nsector = 16.0;
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-
-  // define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = fFrameLzSector[ily] / 2.;
-
-  // define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz / 2.;  // 35 micron copper Drift
-  Double_t dz_sG = fG10Dz / 2.;    // 3mm G10
-  Double_t sdy   = sdy2;
-
-  Double_t pos[10];
-
-  Int_t iMod = 0;
-  for (Int_t iSide = 0; iSide < 1; iSide++) {
-    muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the GEM modules
-    for (Int_t iModule = 0; iModule < 1; iModule++) {
-
-      Double_t phi = 0;  // add 0.5 to not overlap with y-axis for left-right
-                         // layer separation
-      Bool_t isBack = iModule % 2;
-      Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-      // correct the x, y positions
-      pos[0] = fX[ily];
-      pos[1] = fY[ily];
-
-      // different z positions for odd/even modules
-      pos[2] = moduleZ;
-      pos[3] = driftZIn;
-      pos[4] = driftZOut;
-      pos[5] = g10ZIn;
-      pos[6] = g10ZOut;
-      pos[7] = cool_z;
-
-      if (iSide != isBack) continue;
-      if (iModule != 0) iMod = iModule / 2;
-
-      muchLySd = muchLy->GetSide(iSide);
-
-      TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-      TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-      TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-      TGeoMedium* coolMat     = gGeoMan->GetMedium(Al);
-
-      // Define and place the shape of the modules
-      TGeoTrap* shapeGem = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeGem->SetName(Form("shStation%02iLayer%i%cModule%03iActiveGemNoHole", istn, ily, cside, iModule));
-
-      //------------------------------------------------------Al Cooling
-      // Plate--------------------------------------------------------------------
-      TGeoVolume* voActive;
-      TGeoTrap* coolGem;
-      TGeoVolume* voCool;
-
-      coolGem = new TGeoTrap(SupportDz, 0, phi, sdy2, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-      coolGem->SetName(Form("shStation%02iLayer%i%cModule%03icoolGem", istn, ily, cside, iModule));
-      TString CoolName = Form("muchstation%02ilayer%i%ccoolGem%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-      voCool           = new TGeoVolume(CoolName, coolGem, coolMat);
-      voCool->SetLineColor(kYellow);
-
-      //------------------------------------------------------Active
-      // Volume-----------------------------------------------------
-      // GEM
-      TGeoTrap* shapeActive = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-      TString activeName = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iMod + 1);
-      voActive           = new TGeoVolume(activeName, shapeActive, argon);
-      voActive->SetLineColor(kGreen);
-
-      //---------------------------------------------------------Drift &
-      // PCB's---------------------------------------------------------------
-
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftGem[2], *G10Gem[2];
-
-      for (int iPos = 0; iPos < 2; iPos++) {
-        Char_t cpos    = (iPos == 0) ? 'i' : 'o';
-        DriftGem[iPos] = new TGeoTrap(dz_sD, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        G10Gem[iPos]   = new TGeoTrap(dz_sG, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        DriftGem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule, cpos));
-        DriftName[iPos] =
-          Form("muchstation%02ilayer%i%cside%03i%ccopperDrift", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        G10Gem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule, cpos));
-        G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        voDrift[iPos] = new TGeoVolume(DriftName[iPos], DriftGem[iPos], copperplate);
-        voDrift[iPos]->SetLineColor(kRed);
-        voG10[iPos] = new TGeoVolume(G10Name[iPos], G10Gem[iPos], g10plate);
-        voG10[iPos]->SetLineColor(28);
-      }
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, 0, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-      TString expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%"
-                                "02iLayer%i%cModule%03iActiveGemNoHole",
-                                istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-        Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iMod + 1);
-
-      TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // Frame for GEM
-      voFrame->SetLineColor(kMagenta);
-
-      //----------------------------------------------------Placement----------------------------------------------------------------------
-      // Calculate the phi angle of the sector where it has to be placed
-      Double_t angle = 180.0 - (180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-      TGeoRotation* r2 = new TGeoRotation("r2");
-      // rotate in the vertical plane (per to z axis) with angle
-      r2->RotateZ(angle);
-
-      TGeoTranslation* trans[10];
-      TGeoHMatrix* incline_mod[10];
-
-      for (int i = 0; i < 6; i++) {
-        trans[i] = new TGeoTranslation("", pos[0], pos[1], pos[i + 2]);
-
-        incline_mod[i]    = new TGeoHMatrix("");
-        (*incline_mod[i]) = (*trans[i]) * (*r2);
-      }
-
-      volayer->AddNode(voFrame, iMod, incline_mod[0]);     // add spacer
-      volayer->AddNode(voActive, iMod, incline_mod[0]);    // add active volume
-      volayer->AddNode(voDrift[0], iMod, incline_mod[1]);  // Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[2]);  // Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[3]);    // G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[4]);    // G10 Out
-      volayer->AddNode(voCool, iMod, incline_mod[5]);      // Al Cooling Plate
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-      muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[ily], istn, ily, iSide, iModule, Position, 2 * dx1,
-                                                     2 * dx2, 2 * dy, 2 * dz, muchSt->GetRmin()));
-    }
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v22c_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v22c_mcbm.C
deleted file mode 100644
index 6489e3f9b4..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v22c_mcbm.C
+++ /dev/null
@@ -1,442 +0,0 @@
-/* Copyright (C) 2020-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh, Florian Uhlig [committer] */
-
-/*** @author Omveer Singh <omvir.ch@gmail.com>
- ** @date 17 May 2020
- ** For more details see info file*/
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-TObjArray* fStations = new TObjArray();
-CbmMuchStation* muchSt;
-CbmMuchLayer* muchLy;
-CbmMuchLayerSide* muchLySd;
-
-// Name of output file with geometry
-const TString tagVersion = "_v22c";
-// const TString subVersion   = "_sis100_1m_lmvm";
-const TString geoVersion   = "much";  // + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-const TString FileNamePar  = geoVersion + tagVersion + "_mcbm.par.root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString Al                  = "aluminium";  // Al for cooling & support purpose
-const TString copper              = "copper";
-const TString g10                 = "G10";
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-
-Int_t fNlayers        = 2;             // Number of layers
-Double_t fLayersZ0[2] = {65.7, 88.7};  // Layers Positions shifted  z axis old {65.7,118.7)
-// Double_t fLayersZ0[2]  = {85.7, 118.7};   // Layers Positions
-Int_t fDetType[2]      = {3, 3};          // Detector type
-Double_t fX[2]         = {7.2, 7.2};      // Placement of modules in X [cm]
-Double_t fY[2]         = {24.53, 24.53};  // Placement of modules in Y [cm]
-Double_t fSupportLz[2] = {1., 1.};        // (cooling + support)
-Double_t fDriftDz      = 0.0035;          // 35 micron copper Drift
-Double_t fG10Dz        = 0.30;            // 3 mm G10
-
-Double_t fActiveLzSector[2] = {0.3, 0.3};  // Active volume thickness [cm]
-Double_t fFrameLzSector[2]  = {.3, .3};    // Frame thickness [cm]
-Double_t fSpacerPhi         = 2.0;         // Spacer width in Phi [cm]
-Double_t fOverlapR          = 2.0;         // Overlap in R direction [cm]
-Double_t fSpacerR1          = 2.8;         // Spacer width in R at low Z[cm]
-Double_t fSpacerR2          = 3.5;         // Spacer width in R at high Z[cm]
-
-// Size of Modules
-// GEM
-Double_t dy  = 40.0;
-Double_t dx1 = 3.75;
-Double_t dx2 = 20;
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-fstream infoFile;
-void create_MUCH_geometry_v22c_mcbm()
-{
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = FileNameSim;
-  infoFileName.ReplaceAll("root", "info");
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "MUCH geometry created with create_MUCH_geometry_v22c_mcbm.C" << endl << endl;
-  infoFile << "Build a mMUCH setup for mCBM with 2 GEM." << endl;
-  infoFile << "10 mm thick Al plates are used for support and cooling in the "
-              "GEM modules."
-           << endl;
-  infoFile << "Drift and read-out PCBs (copper coated G10 plates) inserted for "
-              "realistic material budget for both GEM and RPC modules."
-           << endl
-           << endl;
-  infoFile << "No of Modules: " << fNlayers << "      ( GEM )" << endl;
-  infoFile << "Position of Modules Z [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fLayersZ0[i] << "    ";
-
-  infoFile << endl << endl << "Placement of Modules:" << endl;
-  infoFile << "Module"
-           << "\t"
-           << "X [cm]"
-           << "\t"
-           << "Y [cm]"
-           << "\t" << endl;
-  infoFile << "----------------------" << endl;
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << " " << i + 1 << "\t" << fX[i] << "\t" << fY[i] << endl;
-  infoFile << "----------------------" << endl;
-  infoFile << endl << "Al Cooling Plate Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fSupportLz[i] << "    ";
-
-  infoFile << endl << "Active Volume Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fActiveLzSector[i] << "    ";
-
-  infoFile << endl << endl << endl << " GEM Module:" << endl;
-  infoFile << "                " << 2 * dx1 << " cm" << endl;
-  infoFile << "               .........                 |" << endl;
-  infoFile << "              ...........                |" << endl;
-  infoFile << "             .............               |" << endl;
-  infoFile << "            ...............              |" << endl;
-  infoFile << "           .................             |" << endl;
-  infoFile << "          ...................            |" << endl;
-  infoFile << "         .....................           |" << endl;
-  infoFile << "        .......................         " << 2 * dy << " cm" << endl;
-  infoFile << "       .........................         |" << endl;
-  infoFile << "      ...........................        |" << endl;
-  infoFile << "     .............................       |" << endl;
-  infoFile << "    ...............................      |" << endl;
-  infoFile << "   .................................     |" << endl;
-  infoFile << "  ...................................    |" << endl;
-  infoFile << " .....................................   |" << endl;
-  infoFile << ".......................................  |" << endl;
-  infoFile << "                " << 2 * dx2 << " cm" << endl;
-  infoFile << endl;
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName = geoVersion + tagVersion + "_mcbm";
-
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {
-
-    Double_t stGlobalZ0 = (fLayersZ0[0] + fLayersZ0[1]) / 2.;
-    muchSt              = new CbmMuchStation(istn, stGlobalZ0);
-    muchSt->SetRmin(0.);
-    muchSt->SetRmax(0.);
-    fStations->Add(muchSt);
-
-    gModules_station[istn] = CreateStations(istn);
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", -6., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-  infoFile.close();
-
-  TFile* parfile = new TFile(FileNamePar, "RECREATE");
-  fStations->Write("stations", 1);  // for geometry parameters
-  parfile->Close();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already
-  // defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* MUCHsupport = geoMedia->getMedium(Al);
-  geoBuild->createMedium(MUCHsupport);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);
-  geoBuild->createMedium(copperplate);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);
-  geoBuild->createMedium(g10plate);
-}
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName         = Form("muchstation%02i", ist + 1);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-  TGeoVolume* gLayer[fNlayers + 1];
-  for (int ii = 0; ii < fNlayers; ii++) {  // 2 Layers
-
-    Double_t sideDz = fSupportLz[ii] / 2. + fActiveLzSector[ii] / 2.;  // distance between side's and layer's centers
-
-    muchLy = new CbmMuchLayer(ist, ii, fLayersZ0[ii], 0.);
-    muchSt->AddLayer(muchLy);
-    muchLy->GetSideF()->SetZ(fLayersZ0[ii] - sideDz);
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[ily] / 2.;
-  Double_t driftDz   = fActiveLzSector[ily] / 2 + fDriftDz / 2.;
-  Double_t g10Dz     = driftDz + fDriftDz / 2. + fG10Dz / 2.;
-
-  Double_t moduleZ   = fLayersZ0[ily];
-  Double_t driftZIn  = moduleZ - driftDz;
-  Double_t driftZOut = moduleZ + driftDz;
-  Double_t g10ZIn    = moduleZ - g10Dz;
-  Double_t g10ZOut   = moduleZ + g10Dz;
-  Double_t cool_z    = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz = fActiveLzSector[ily] / 2.;  // Active Volume Thickness
-
-  Int_t Nsector = 16.0;
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-
-  // define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = fFrameLzSector[ily] / 2.;
-
-  // define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz / 2.;  // 35 micron copper Drift
-  Double_t dz_sG = fG10Dz / 2.;    // 3mm G10
-  Double_t sdy   = sdy2;
-
-  Double_t pos[10];
-
-  Int_t iMod = 0;
-  for (Int_t iSide = 0; iSide < 1; iSide++) {
-    muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the GEM modules
-    for (Int_t iModule = 0; iModule < 1; iModule++) {
-
-      Double_t phi = 0;  // add 0.5 to not overlap with y-axis for left-right
-                         // layer separation
-      Bool_t isBack = iModule % 2;
-      Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-      // correct the x, y positions
-      pos[0] = fX[ily];
-      pos[1] = fY[ily];
-
-      // different z positions for odd/even modules
-      pos[2] = moduleZ;
-      pos[3] = driftZIn;
-      pos[4] = driftZOut;
-      pos[5] = g10ZIn;
-      pos[6] = g10ZOut;
-      pos[7] = cool_z;
-
-      if (iSide != isBack) continue;
-      if (iModule != 0) iMod = iModule / 2;
-
-      muchLySd = muchLy->GetSide(iSide);
-
-      TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-      TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-      TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-      TGeoMedium* coolMat     = gGeoMan->GetMedium(Al);
-
-      // Define and place the shape of the modules
-      TGeoTrap* shapeGem = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeGem->SetName(Form("shStation%02iLayer%i%cModule%03iActiveGemNoHole", istn, ily, cside, iModule));
-
-      //------------------------------------------------------Al Cooling
-      // Plate--------------------------------------------------------------------
-      TGeoVolume* voActive;
-      TGeoTrap* coolGem;
-      TGeoVolume* voCool;
-
-      coolGem = new TGeoTrap(SupportDz, 0, phi, sdy2, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-      coolGem->SetName(Form("shStation%02iLayer%i%cModule%03icoolGem", istn, ily, cside, iModule));
-      TString CoolName = Form("muchstation%02ilayer%i%ccoolGem%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-      voCool           = new TGeoVolume(CoolName, coolGem, coolMat);
-      voCool->SetLineColor(kYellow);
-
-      //------------------------------------------------------Active
-      // Volume-----------------------------------------------------
-      // GEM
-      TGeoTrap* shapeActive = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-      TString activeName = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iMod + 1);
-      voActive           = new TGeoVolume(activeName, shapeActive, argon);
-      voActive->SetLineColor(kGreen);
-
-      //---------------------------------------------------------Drift &
-      // PCB's---------------------------------------------------------------
-
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftGem[2], *G10Gem[2];
-
-      for (int iPos = 0; iPos < 2; iPos++) {
-        Char_t cpos    = (iPos == 0) ? 'i' : 'o';
-        DriftGem[iPos] = new TGeoTrap(dz_sD, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        G10Gem[iPos]   = new TGeoTrap(dz_sG, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        DriftGem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule, cpos));
-        DriftName[iPos] =
-          Form("muchstation%02ilayer%i%cside%03i%ccopperDrift", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        G10Gem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule, cpos));
-        G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        voDrift[iPos] = new TGeoVolume(DriftName[iPos], DriftGem[iPos], copperplate);
-        voDrift[iPos]->SetLineColor(kRed);
-        voG10[iPos] = new TGeoVolume(G10Name[iPos], G10Gem[iPos], g10plate);
-        voG10[iPos]->SetLineColor(28);
-      }
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, 0, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-      TString expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%"
-                                "02iLayer%i%cModule%03iActiveGemNoHole",
-                                istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-        Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iMod + 1);
-
-      TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // Frame for GEM
-      voFrame->SetLineColor(kMagenta);
-
-      //----------------------------------------------------Placement----------------------------------------------------------------------
-      // Calculate the phi angle of the sector where it has to be placed
-      Double_t angle = 180.0 - (180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-      TGeoRotation* r2 = new TGeoRotation("r2");
-      // rotate in the vertical plane (per to z axis) with angle
-      r2->RotateZ(angle);
-
-      TGeoTranslation* trans[10];
-      TGeoHMatrix* incline_mod[10];
-
-      for (int i = 0; i < 6; i++) {
-        trans[i] = new TGeoTranslation("", pos[0], pos[1], pos[i + 2]);
-
-        incline_mod[i]    = new TGeoHMatrix("");
-        (*incline_mod[i]) = (*trans[i]) * (*r2);
-      }
-
-      volayer->AddNode(voFrame, iMod, incline_mod[0]);     // add spacer
-      volayer->AddNode(voActive, iMod, incline_mod[0]);    // add active volume
-      volayer->AddNode(voDrift[0], iMod, incline_mod[1]);  // Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[2]);  // Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[3]);    // G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[4]);    // G10 Out
-      volayer->AddNode(voCool, iMod, incline_mod[5]);      // Al Cooling Plate
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-      muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[ily], istn, ily, iSide, iModule, Position, 2 * dx1,
-                                                     2 * dx2, 2 * dy, 2 * dz, muchSt->GetRmin()));
-    }
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v22d_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v22d_mcbm.C
deleted file mode 100644
index 0a53c4a20a..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v22d_mcbm.C
+++ /dev/null
@@ -1,442 +0,0 @@
-/* Copyright (C) 2020-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh, Florian Uhlig [committer] */
-
-/*** @author Omveer Singh <omvir.ch@gmail.com>
- ** @date 17 May 2020
- ** For more details see info file*/
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-TObjArray* fStations = new TObjArray();
-CbmMuchStation* muchSt;
-CbmMuchLayer* muchLy;
-CbmMuchLayerSide* muchLySd;
-
-// Name of output file with geometry
-const TString tagVersion = "_v22d";
-// const TString subVersion   = "_sis100_1m_lmvm";
-const TString geoVersion   = "much";  // + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-const TString FileNamePar  = geoVersion + tagVersion + "_mcbm.par.root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString Al                  = "aluminium";  // Al for cooling & support purpose
-const TString copper              = "copper";
-const TString g10                 = "G10";
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 1;  // Number of stations
-
-Int_t fNlayers        = 2;              // Number of layers
-Double_t fLayersZ0[2] = {65.7, 118.7};  // Layers Positions
-// Double_t fLayersZ0[2]  = {85.7, 118.7};   // Layers Positions
-Int_t fDetType[2]      = {3, 3};          // Detector type
-Double_t fX[2]         = {7.2, 7.2};      // Placement of modules in X [cm]
-Double_t fY[2]         = {24.53, 24.53};  // Placement of modules in Y [cm]
-Double_t fSupportLz[2] = {1., 1.};        // (cooling + support)
-Double_t fDriftDz      = 0.0035;          // 35 micron copper Drift
-Double_t fG10Dz        = 0.30;            // 3 mm G10
-
-Double_t fActiveLzSector[2] = {0.3, 0.3};  // Active volume thickness [cm]
-Double_t fFrameLzSector[2]  = {.3, .3};    // Frame thickness [cm]
-Double_t fSpacerPhi         = 2.0;         // Spacer width in Phi [cm]
-Double_t fOverlapR          = 2.0;         // Overlap in R direction [cm]
-Double_t fSpacerR1          = 2.8;         // Spacer width in R at low Z[cm]
-Double_t fSpacerR2          = 3.5;         // Spacer width in R at high Z[cm]
-
-// Size of Modules
-// GEM
-Double_t dy  = 40.0;
-Double_t dx1 = 3.75;
-Double_t dx2 = 20;
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayers(int istn, int ily);
-
-fstream infoFile;
-void create_MUCH_geometry_v22d_mcbm()
-{
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = FileNameSim;
-  infoFileName.ReplaceAll("root", "info");
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "MUCH geometry created with create_MUCH_geometry_v22d_mcbm.C" << endl << endl;
-  infoFile << "Build a mMUCH setup for mCBM with 1 GEM." << endl;
-  infoFile << "10 mm thick Al plates are used for support and cooling in the "
-              "GEM modules."
-           << endl;
-  infoFile << "Drift and read-out PCBs (copper coated G10 plates) inserted for "
-              "realistic material budget for both GEM and RPC modules."
-           << endl
-           << endl;
-  infoFile << "No of Modules: " << fNlayers << "      ( GEM )" << endl;
-  infoFile << "Position of Modules Z [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fLayersZ0[i] << "    ";
-
-  infoFile << endl << endl << "Placement of Modules:" << endl;
-  infoFile << "Module"
-           << "\t"
-           << "X [cm]"
-           << "\t"
-           << "Y [cm]"
-           << "\t" << endl;
-  infoFile << "----------------------" << endl;
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << " " << i + 1 << "\t" << fX[i] << "\t" << fY[i] << endl;
-  infoFile << "----------------------" << endl;
-  infoFile << endl << "Al Cooling Plate Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fSupportLz[i] << "    ";
-
-  infoFile << endl << "Active Volume Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fActiveLzSector[i] << "    ";
-
-  infoFile << endl << endl << endl << " GEM Module:" << endl;
-  infoFile << "                " << 2 * dx1 << " cm" << endl;
-  infoFile << "               .........                 |" << endl;
-  infoFile << "              ...........                |" << endl;
-  infoFile << "             .............               |" << endl;
-  infoFile << "            ...............              |" << endl;
-  infoFile << "           .................             |" << endl;
-  infoFile << "          ...................            |" << endl;
-  infoFile << "         .....................           |" << endl;
-  infoFile << "        .......................         " << 2 * dy << " cm" << endl;
-  infoFile << "       .........................         |" << endl;
-  infoFile << "      ...........................        |" << endl;
-  infoFile << "     .............................       |" << endl;
-  infoFile << "    ...............................      |" << endl;
-  infoFile << "   .................................     |" << endl;
-  infoFile << "  ...................................    |" << endl;
-  infoFile << " .....................................   |" << endl;
-  infoFile << ".......................................  |" << endl;
-  infoFile << "                " << 2 * dx2 << " cm" << endl;
-  infoFile << endl;
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName = geoVersion + tagVersion + "_mcbm";
-
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");
-  much->AddNode(sttn, 1);
-
-  for (Int_t istn = 0; istn < 1; istn++) {
-
-    Double_t stGlobalZ0 = (fLayersZ0[0] + fLayersZ0[1]) / 2.;
-    muchSt              = new CbmMuchStation(istn, stGlobalZ0);
-    muchSt->SetRmin(0.);
-    muchSt->SetRmax(0.);
-    fStations->Add(muchSt);
-
-    gModules_station[istn] = CreateStations(istn);
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", -6., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-  infoFile.close();
-
-  TFile* parfile = new TFile(FileNamePar, "RECREATE");
-  fStations->Write("stations", 1);  // for geometry parameters
-  parfile->Close();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already
-  // defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* MUCHsupport = geoMedia->getMedium(Al);
-  geoBuild->createMedium(MUCHsupport);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);
-  geoBuild->createMedium(copperplate);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);
-  geoBuild->createMedium(g10plate);
-}
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName         = Form("muchstation%02i", ist + 1);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-  TGeoVolume* gLayer[fNlayers + 1];
-  for (int ii = 0; ii < 1; ii++) {  // 1 Layers
-
-    Double_t sideDz = fSupportLz[ii] / 2. + fActiveLzSector[ii] / 2.;  // distance between side's and layer's centers
-
-    muchLy = new CbmMuchLayer(ist, ii, fLayersZ0[ii], 0.);
-    muchSt->AddLayer(muchLy);
-    muchLy->GetSideF()->SetZ(fLayersZ0[ii] - sideDz);
-
-    gLayer[ii] = CreateLayers(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-TGeoVolume* CreateLayers(int istn, int ily)
-{
-
-  TString layerName = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[ily] / 2.;
-  Double_t driftDz   = fActiveLzSector[ily] / 2 + fDriftDz / 2.;
-  Double_t g10Dz     = driftDz + fDriftDz / 2. + fG10Dz / 2.;
-
-  Double_t moduleZ   = fLayersZ0[ily];
-  Double_t driftZIn  = moduleZ - driftDz;
-  Double_t driftZOut = moduleZ + driftDz;
-  Double_t g10ZIn    = moduleZ - g10Dz;
-  Double_t g10ZOut   = moduleZ + g10Dz;
-  Double_t cool_z    = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz = fActiveLzSector[ily] / 2.;  // Active Volume Thickness
-
-  Int_t Nsector = 16.0;
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-
-  // define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = fFrameLzSector[ily] / 2.;
-
-  // define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz / 2.;  // 35 micron copper Drift
-  Double_t dz_sG = fG10Dz / 2.;    // 3mm G10
-  Double_t sdy   = sdy2;
-
-  Double_t pos[10];
-
-  Int_t iMod = 0;
-  for (Int_t iSide = 0; iSide < 1; iSide++) {
-    muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the GEM modules
-    for (Int_t iModule = 0; iModule < 1; iModule++) {
-
-      Double_t phi = 0;  // add 0.5 to not overlap with y-axis for left-right
-                         // layer separation
-      Bool_t isBack = iModule % 2;
-      Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-      // correct the x, y positions
-      pos[0] = fX[ily];
-      pos[1] = fY[ily];
-
-      // different z positions for odd/even modules
-      pos[2] = moduleZ;
-      pos[3] = driftZIn;
-      pos[4] = driftZOut;
-      pos[5] = g10ZIn;
-      pos[6] = g10ZOut;
-      pos[7] = cool_z;
-
-      if (iSide != isBack) continue;
-      if (iModule != 0) iMod = iModule / 2;
-
-      muchLySd = muchLy->GetSide(iSide);
-
-      TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-      TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-      TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-      TGeoMedium* coolMat     = gGeoMan->GetMedium(Al);
-
-      // Define and place the shape of the modules
-      TGeoTrap* shapeGem = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeGem->SetName(Form("shStation%02iLayer%i%cModule%03iActiveGemNoHole", istn, ily, cside, iModule));
-
-      //------------------------------------------------------Al Cooling
-      // Plate--------------------------------------------------------------------
-      TGeoVolume* voActive;
-      TGeoTrap* coolGem;
-      TGeoVolume* voCool;
-
-      coolGem = new TGeoTrap(SupportDz, 0, phi, sdy2, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-      coolGem->SetName(Form("shStation%02iLayer%i%cModule%03icoolGem", istn, ily, cside, iModule));
-      TString CoolName = Form("muchstation%02ilayer%i%ccoolGem%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-      voCool           = new TGeoVolume(CoolName, coolGem, coolMat);
-      voCool->SetLineColor(kYellow);
-
-      //------------------------------------------------------Active
-      // Volume-----------------------------------------------------
-      // GEM
-      TGeoTrap* shapeActive = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-      TString activeName = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iMod + 1);
-      voActive           = new TGeoVolume(activeName, shapeActive, argon);
-      voActive->SetLineColor(kGreen);
-
-      //---------------------------------------------------------Drift &
-      // PCB's---------------------------------------------------------------
-
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftGem[2], *G10Gem[2];
-
-      for (int iPos = 0; iPos < 2; iPos++) {
-        Char_t cpos    = (iPos == 0) ? 'i' : 'o';
-        DriftGem[iPos] = new TGeoTrap(dz_sD, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        G10Gem[iPos]   = new TGeoTrap(dz_sG, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        DriftGem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule, cpos));
-        DriftName[iPos] =
-          Form("muchstation%02ilayer%i%cside%03i%ccopperDrift", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        G10Gem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule, cpos));
-        G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        voDrift[iPos] = new TGeoVolume(DriftName[iPos], DriftGem[iPos], copperplate);
-        voDrift[iPos]->SetLineColor(kRed);
-        voG10[iPos] = new TGeoVolume(G10Name[iPos], G10Gem[iPos], g10plate);
-        voG10[iPos]->SetLineColor(28);
-      }
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, 0, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-      TString expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%"
-                                "02iLayer%i%cModule%03iActiveGemNoHole",
-                                istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-        Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iMod + 1);
-
-      TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // Frame for GEM
-      voFrame->SetLineColor(kMagenta);
-
-      //----------------------------------------------------Placement----------------------------------------------------------------------
-      // Calculate the phi angle of the sector where it has to be placed
-      Double_t angle = 180.0 - (180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-      TGeoRotation* r2 = new TGeoRotation("r2");
-      // rotate in the vertical plane (per to z axis) with angle
-      r2->RotateZ(angle);
-
-      TGeoTranslation* trans[10];
-      TGeoHMatrix* incline_mod[10];
-
-      for (int i = 0; i < 6; i++) {
-        trans[i] = new TGeoTranslation("", pos[0], pos[1], pos[i + 2]);
-
-        incline_mod[i]    = new TGeoHMatrix("");
-        (*incline_mod[i]) = (*trans[i]) * (*r2);
-      }
-
-      volayer->AddNode(voFrame, iMod, incline_mod[0]);     // add spacer
-      volayer->AddNode(voActive, iMod, incline_mod[0]);    // add active volume
-      volayer->AddNode(voDrift[0], iMod, incline_mod[1]);  // Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[2]);  // Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[3]);    // G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[4]);    // G10 Out
-      volayer->AddNode(voCool, iMod, incline_mod[5]);      // Al Cooling Plate
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-      muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[ily], istn, ily, iSide, iModule, Position, 2 * dx1,
-                                                     2 * dx2, 2 * dy, 2 * dz, muchSt->GetRmin()));
-    }
-  }
-
-  return volayer;
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v22e_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v22e_mcbm.C
deleted file mode 100644
index d996a1db95..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v22e_mcbm.C
+++ /dev/null
@@ -1,774 +0,0 @@
-/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh, Shreya Roy, Florian Uhlig [committer] */
-
-/*** @author Omveer Singh <omvir.ch@gmail.com>
- ** @date 17 May 2020
- ** For more details see info file*/
-
-// clang-format off
-
-// 2022-03-10 - DE - v22e - apply -2 degree rotation around the x-axis on the RPC module
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-TObjArray* fStations = new TObjArray();
-CbmMuchStation* muchSt;
-CbmMuchLayer* muchLy;
-CbmMuchLayerSide* muchLySd;
-
-// Name of output file with geometry
-const TString tagVersion = "_v22e";
-//const TString subVersion   = "_sis100_1m_lmvm";
-const TString geoVersion   = "much";  // + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-const TString FileNamePar  = geoVersion + tagVersion + "_mcbm.par.root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString Al                  = "aluminium";  //Al for cooling & support purpose
-const TString copper              = "copper";
-const TString g10                 = "G10";
-const TString RPCm= "RPCgas";
-const TString RPCg= "RPCglass";
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 3;  // Number of stations
-Double_t TOF_Z_Front_Stand = 244.5;  // this is the TOF box front
-//Double_t TOF_Z_Front_Stand = 247.;  // this is the TOF RPC front
-Double_t RpcDistanceFromTof = 7.+1.9;  // add half thickness of RPC - gap is between backside of RPC and front of TOF
-//Double_t RpcDistanceFromTof = 7.;
-Double_t RpcPositionZ = TOF_Z_Front_Stand - RpcDistanceFromTof;
-Int_t fNlayers         = 1;               // Number of layers
-Double_t fLayersZ0[fNst]  = {75.7, 108.7, RpcPositionZ};   // Layers Positions
-//Double_t fLayersZ0[fNst]  = {65.7, 88.7, RpcPositionZ};   // Layers Positions
-Int_t fDetType[fNst]      = {3, 3, 4};          // Detector type
-Double_t fSupportLz[fNst] = {1., 1., 0};        // (cooling + support)
-Double_t fDriftDz      = 0.0035;          //35 micron copper Drift
-Double_t fG10Dz        = 0.30;            // 3 mm G10
-
-Double_t fActiveLzSector[fNst] = {0.3, 0.3, 0.2};  // Active volume thickness [cm]
-Double_t fFrameLzSector[fNst]  = {.3, .3, .6};    // Frame thickness [cm]
-Double_t fRpcGlassDz[fNst] = {0.0,0.0,0.2}; //Rpc Glass thickness [cm]
-Double_t fSpacerPhi         = 2.0;         // Spacer width in Phi [cm]
-Double_t fOverlapR          = 2.0;         // Overlap in R direction [cm]
-Double_t fSpacerR1          = 2.8;         // Spacer width in R at low Z[cm]
-Double_t fSpacerR2          = 3.5;         // Spacer width in R at high Z[cm]
-
-//Size of Modules
-//GEM
-Double_t dy  = 40.0;
-Double_t dx1 = 3.75;
-Double_t dx2 = 20;
-
-
-//RPC
-Double_t dyR  = 116.13/2.; 
-Double_t dx1R = 10.26/2.;
-Double_t dx2R = 50.98/2.;
-
-//box size
-Double_t dxx  = 74.0/2. ; 
-Double_t dyy = 123.0/2.;
-Double_t dzz = 3.8/2.;
-
-
-Double_t DetectorAxisHeight = 200.; //reference ground
-Double_t BoxBaseHeight = 153.5 ;
-Double_t BoxCentreHeight = BoxBaseHeight + dyy;
-Double_t BoxAwayBeamAxisY = BoxCentreHeight - DetectorAxisHeight;
-
-
-Double_t RpcBaseHeight = BoxBaseHeight + 4.5 ;
-Double_t RpcCentreHeight = RpcBaseHeight + dyR;
-Double_t RpcAwayBeamAxisY = RpcCentreHeight - DetectorAxisHeight;
-
-//Position of Box
-Double_t posBox[]={0,BoxAwayBeamAxisY}; //from the detector axis
-
-
-Double_t fX[fNst]         = {7.2, 7.2, 0.};      //Placement of modules in X [cm]
-Double_t fY[fNst]         = {24.53, 24.53, RpcAwayBeamAxisY};  //Placement of modules in Y [cm]
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayersGem(int istn, int ily);
-TGeoVolume* CreateLayersRpc(int istn, int ily);
-
-
-fstream infoFile;
-void create_MUCH_geometry_v22e_mcbm()
-{
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = FileNameSim;
-  infoFileName.ReplaceAll("root", "info");
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "MUCH geometry created with create_MUCH_geometry_v22e_mcbm.C" << endl << endl;
-  infoFile << "Build a mMUCH setup for mCBM with 2 GEM." << endl;
-  infoFile << "10 mm thick Al plates are used for support and cooling in the "
-              "GEM modules."
-           << endl;
-  infoFile << "Drift and read-out PCBs (copper coated G10 plates) inserted for "
-              "realistic material budget for both GEM and RPC modules."
-           << endl
-           << endl;
-  infoFile << "No of Modules: " << fNlayers << "      ( GEM )" << endl;
-  infoFile << "Position of Modules Z [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fLayersZ0[i] << "    ";
-
-  infoFile << endl << endl << "Placement of Modules:" << endl;
-  infoFile << "Module"
-           << "\t"
-           << "X [cm]"
-           << "\t"
-           << "Y [cm]"
-           << "\t" << endl;
-  infoFile << "----------------------" << endl;
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << " " << i + 1 << "\t" << fX[i] << "\t" << fY[i] << endl;
-  infoFile << "----------------------" << endl;
-  infoFile << endl << "Al Cooling Plate Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fSupportLz[i] << "    ";
-
-  infoFile << endl << "Active Volume Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fActiveLzSector[i] << "    ";
-
-  infoFile << endl << endl << endl << " GEM Module:" << endl;
-  infoFile << "                " << 2 * dx1 << " cm" << endl;
-  infoFile << "               .........                 |" << endl;
-  infoFile << "              ...........                |" << endl;
-  infoFile << "             .............               |" << endl;
-  infoFile << "            ...............              |" << endl;
-  infoFile << "           .................             |" << endl;
-  infoFile << "          ...................            |" << endl;
-  infoFile << "         .....................           |" << endl;
-  infoFile << "        .......................         " << 2 * dy << " cm" << endl;
-  infoFile << "       .........................         |" << endl;
-  infoFile << "      ...........................        |" << endl;
-  infoFile << "     .............................       |" << endl;
-  infoFile << "    ...............................      |" << endl;
-  infoFile << "   .................................     |" << endl;
-  infoFile << "  ...................................    |" << endl;
-  infoFile << " .....................................   |" << endl;
-  infoFile << ".......................................  |" << endl;
-  infoFile << "                " << 2 * dx2 << " cm" << endl;
-  infoFile << endl;
-
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName = geoVersion + tagVersion + "_mcbm";
-
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");
-  much->AddNode(sttn, 1);
-
-
-  for (Int_t istn = 0; istn < fNst; istn++) {
-
-    Double_t stGlobalZ0 = fLayersZ0[istn];
-    muchSt              = new CbmMuchStation(istn, stGlobalZ0);
-    muchSt->SetRmin(0.);
-    muchSt->SetRmax(0.);
-    fStations->Add(muchSt);
-
-
-    gModules_station[istn] = CreateStations(istn);
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", -6., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-  infoFile.close();
-
-  TFile* parfile = new TFile(FileNamePar, "RECREATE");
-  fStations->Write("stations", 1);  // for geometry parameters
-  parfile->Close();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* MUCHsupport = geoMedia->getMedium(Al);
-  geoBuild->createMedium(MUCHsupport);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);
-  geoBuild->createMedium(copperplate);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);
-  geoBuild->createMedium(g10plate);
-
-  FairGeoMedium* RPCmedium = geoMedia->getMedium(RPCm);
-  geoBuild->createMedium(RPCmedium);
-
-  FairGeoMedium* RPCmaterial = geoMedia->getMedium(RPCg);
-  geoBuild->createMedium(RPCmaterial);
-
-}
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName         = Form("muchstation%02i", ist + 1);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-  TGeoVolume* gLayer[fNlayers + 1];
-  for (int ii = 0; ii < fNlayers; ii++) {  // 2 Layers
-
-   // Double_t sideDz = fSupportLz[istn] / 2. + fActiveLzSector[istn] / 2.;  // distance between side's and layer's centers
-
-    muchLy = new CbmMuchLayer(ist, ii, fLayersZ0[ist], 0.);
-    muchSt->AddLayer(muchLy);
-    muchLy->GetSideF()->SetZ(fLayersZ0[ist] );  
-
-
- if(ist<2)gLayer[ii] = CreateLayersGem(ist, ii);
-   else gLayer[ii] = CreateLayersRpc(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-TGeoVolume* CreateLayersGem(int istn, int ily)
-{
-
-  TString layerName = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[istn] / 2.;
-  Double_t driftDz   = fActiveLzSector[istn] / 2 + fDriftDz / 2.;
-  Double_t g10Dz     = driftDz + fDriftDz / 2. + fG10Dz / 2.;
-
-
-  Double_t moduleZ   = fLayersZ0[istn];
-  Double_t driftZIn  = moduleZ - driftDz;
-  Double_t driftZOut = moduleZ + driftDz;
-  Double_t g10ZIn    = moduleZ - g10Dz;
-  Double_t g10ZOut   = moduleZ + g10Dz;
-  Double_t cool_z    = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz = fActiveLzSector[istn] / 2.;  // Active Volume Thickness
-
-  Int_t Nsector = 16.0;
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = fFrameLzSector[istn] / 2.;
-
-  //define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz / 2.;  //35 micron copper Drift
-  Double_t dz_sG = fG10Dz / 2.;    // 3mm G10
-  Double_t sdy   = sdy2;
-
-
-  Double_t pos[10];
-
-  Int_t iMod = 0;
-  for (Int_t iSide = 0; iSide < 1; iSide++) {
-    //muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the GEM modules
-    for (Int_t iModule = 0; iModule < 1; iModule++) {
-
-      Double_t phi  = 0;  // add 0.5 to not overlap with y-axis for left-right layer separation
-      Bool_t isBack = iModule % 2;
-      Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-      // correct the x, y positions
-      pos[0] = fX[istn];
-      pos[1] = fY[istn];
-
-
-      // different z positions for odd/even modules
-      pos[2] = moduleZ;
-      pos[3] = driftZIn;
-      pos[4] = driftZOut;
-      pos[5] = g10ZIn;
-      pos[6] = g10ZOut;
-      pos[7] = cool_z;
-
-      if (iSide != isBack) continue;
-      if (iModule != 0) iMod = iModule / 2;
-
-      muchLySd = muchLy->GetSide(iSide);
-
-      TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-      TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-      TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-      TGeoMedium* coolMat     = gGeoMan->GetMedium(Al);
-
-
-      // Define and place the shape of the modules
-      TGeoTrap* shapeGem = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeGem->SetName(Form("shStation%02iLayer%i%cModule%03iActiveGemNoHole", istn, ily, cside, iModule));
-
-      //------------------------------------------------------Al Cooling Plate--------------------------------------------------------------------
-      TGeoVolume* voActive;
-      TGeoTrap* coolGem;
-      TGeoVolume* voCool;
-
-      coolGem = new TGeoTrap(SupportDz, 0, phi, sdy2, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-      coolGem->SetName(Form("shStation%02iLayer%i%cModule%03icoolGem", istn, ily, cside, iModule));
-      TString CoolName = Form("muchstation%02ilayer%i%ccoolGem%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-      voCool           = new TGeoVolume(CoolName, coolGem, coolMat);
-      voCool->SetLineColor(kYellow);
-
-      //------------------------------------------------------Active Volume-----------------------------------------------------
-      //GEM
-      TGeoTrap* shapeActive = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-      TString activeName = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iMod + 1);
-      voActive           = new TGeoVolume(activeName, shapeActive, argon);
-      voActive->SetLineColor(kGreen);
-
-
-      //---------------------------------------------------------Drift & PCB's---------------------------------------------------------------
-
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftGem[2], *G10Gem[2];
-
-      for (int iPos = 0; iPos < 2; iPos++) {
-        Char_t cpos    = (iPos == 0) ? 'i' : 'o';
-        DriftGem[iPos] = new TGeoTrap(dz_sD, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        G10Gem[iPos]   = new TGeoTrap(dz_sG, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        DriftGem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule, cpos));
-        DriftName[iPos] =
-          Form("muchstation%02ilayer%i%cside%03i%ccopperDrift", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        G10Gem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule, cpos));
-        G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        voDrift[iPos] = new TGeoVolume(DriftName[iPos], DriftGem[iPos], copperplate);
-        voDrift[iPos]->SetLineColor(kRed);
-        voG10[iPos] = new TGeoVolume(G10Name[iPos], G10Gem[iPos], g10plate);
-        voG10[iPos]->SetLineColor(28);
-      }
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, 0, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-
-      TString expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%"
-                                "02iLayer%i%cModule%03iActiveGemNoHole",
-                                istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-        Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iMod + 1);
-
-      TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // Frame for GEM
-      voFrame->SetLineColor(kMagenta);
-
-
-      //----------------------------------------------------Placement----------------------------------------------------------------------
-      // Calculate the phi angle of the sector where it has to be placed
-      Double_t angle = 180.0 - (180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-
-      TGeoRotation* r2 = new TGeoRotation("r2");
-      //rotate in the vertical plane (per to z axis) with angle
-      r2->RotateZ(angle);
-
-
-      TGeoTranslation* trans[10];
-      TGeoHMatrix* incline_mod[10];
-
-      for (int i = 0; i < 6; i++) {
-        trans[i] = new TGeoTranslation("", pos[0], pos[1], pos[i + 2]);
-
-        incline_mod[i]    = new TGeoHMatrix("");
-        (*incline_mod[i]) = (*trans[i]) * (*r2);
-      }
-
-      volayer->AddNode(voFrame, iMod, incline_mod[0]);     // add spacer
-      volayer->AddNode(voActive, iMod, incline_mod[0]);    // add active volume
-      volayer->AddNode(voDrift[0], iMod, incline_mod[1]);  //Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[2]);  //Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[3]);    //G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[4]);    //G10 Out
-      volayer->AddNode(voCool, iMod, incline_mod[5]);      // Al Cooling Plate
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-     muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[istn], istn, ily, iSide, iModule, Position, dx1,
-                                                     dx2,  dy,  dz, muchSt->GetRmin()));
-cout<<"stn: "<<istn<<"   module: "<<iModule<<endl;
-    }
-  }
-
-  return volayer;
-}
-
-TGeoVolume* CreateLayersRpc(int istn, int ily){
-
- 
- TString layerName;
- 
-   layerName = Form("muchstation%02ilayerRpc%i",istn+1,ily+1);
-  
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[istn]/2.;
-  Double_t RpcGlassDz = fActiveLzSector[istn]/2. + fRpcGlassDz[istn]/2.;
-  Double_t driftDz = RpcGlassDz + fRpcGlassDz[istn]/2 + fDriftDz/2.;
-  Double_t g10Dz = driftDz + fDriftDz/2. + fG10Dz/2.;
-  Double_t FrameRpcDz = fActiveLzSector[istn]/2. + fRpcGlassDz[istn] + fDriftDz + g10Dz + fG10Dz;
-  
-  Double_t moduleZ = fLayersZ0[istn]; 
-  Double_t RpcGlassZIn = moduleZ - RpcGlassDz;
-  Double_t RpcGlassZOut = moduleZ + RpcGlassDz;
-  Double_t driftZIn = moduleZ - driftDz; 
-  Double_t driftZOut = moduleZ + driftDz; 
-  Double_t g10ZIn = moduleZ - g10Dz;
-  Double_t g10ZOut = moduleZ + g10Dz;
- // Double_t cool_z = g10ZOut + fG10Dz/2. + SupportDz;
-  Double_t cool_z = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz  = fActiveLzSector[istn]/2.; // Active Volume Thickness 
-  
-  Int_t Nsector=16.0;
-  Double_t phi0 = TMath::Pi()/Nsector; // azimuthal half widh of each module
-
-  dx1 = dx1R; dx2 = dx2R; dy = dyR;
-  //define the spacer dimensions      
-  Double_t tg = (dx2-dx1)/2/dy;
-  Double_t dd1 = fSpacerPhi*tg;
-  Double_t dd2 = fSpacerPhi*sqrt(1+tg*tg);
-  Double_t sdx1 = dx1+dd2-dd1;
-  Double_t sdx2 = dx2+dd2+dd1; 
-  Double_t sdy1  = dy+fSpacerR1; // frame width added 
-  Double_t sdy2  = dy+fSpacerR2; // frame width added
-  Double_t sdz = fFrameLzSector[istn]/2.;
-  
-  //define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz/2.; //35 micron copper Drift 
-  Double_t dz_sG = fG10Dz/2.; // 3mm G10
-  Double_t sdy = sdy2;
-  
-  
-  Double_t pos[10];
-  
-  Int_t iMod =0;
-  for (Int_t iSide=0;iSide<1;iSide++){
-     // muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the Rpc modules  
-    for (Int_t iModule=0; iModule<1; iModule++){ 
-      
-      Double_t phi  = 0;  // add 0.5 to not overlap with y-axis for left-right layer separation
-      Bool_t isBack = iModule%2; 
-      Char_t cside  = (isBack==1) ? 'b' : 'f'; 
-      
-      // correct the x, y positions
-      pos[0] = fX[istn];   
-      pos[1] = fY[istn];
-      
-      
-      
-      // different z positions for odd/even modules
-      pos[2] = moduleZ ;
-      pos[3] = RpcGlassZIn;
-      pos[4] = RpcGlassZOut;
-      pos[5] = driftZIn;
-      pos[6] = driftZOut;
-      pos[7] = g10ZIn;
-      pos[8] = g10ZOut;
-      pos[9] = cool_z;
-      
-      if(iSide!=isBack)continue;
-      if(iModule!=0)iMod =iModule/2;
-      
-      muchLySd = muchLy->GetSide(iSide);  
-    
-
-      TGeoMedium* SpacerRpc = gGeoMan->GetMedium(Al); // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper); // copper Drift medium
-      TGeoMedium* g10plate = gGeoMan->GetMedium(g10); // G10 medium
-      TGeoMedium*  RPCglassmat = gGeoMan->GetMedium(RPCg); // RPC Glass
-      TGeoMedium*  RPCgasmedium = gGeoMan->GetMedium(RPCm); // RPC Gas
-      TGeoMedium* coolMat = gGeoMan->GetMedium(Al);
-      
-
-      TGeoTrap* shapeRpc = new TGeoTrap(sdz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-     // TGeoBBox * shapeRpc = new TGeoBBox(dxx,dyy,FrameRpcDz);
-      shapeRpc->SetName(Form("shStation%02iLayer%i%cModule%03iActiveRpcNoHole", istn, ily, cside, iModule));
-      
-      //------------------------------------------------------Al Cooling Plate--------------------------------------------------------------------
-      TGeoVolume* voActive, *voRPCback, *voRPCFront;      
-      TGeoTrap * coolRpc;
-      TGeoVolume* voCool;
-   
-	coolRpc = new TGeoTrap(SupportDz,0,phi,sdy2,sdx1,sdx2,0,sdy2,sdx1,sdx2,0);
-	coolRpc->SetName(Form("shStation%02iLayer%i%cModule%03icoolRpc", istn, ily, cside, iModule));
-	TString CoolName = Form("muchstation%02ilayer%i%ccoolRpc%03iAluminum",istn+1,ily+1,cside,iModule+1);
-	voCool = new TGeoVolume(CoolName,coolRpc,coolMat);
-	voCool->SetLineColor(kYellow);
-     
-      
-      
-      //------------------------------------------------------Active Volume & Rpc Glass----------------------------------------------------- 
- 
-          //RPC Active
-          TGeoTrap* shapeActive = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-          shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-	  TString activeName = Form("muchstation%02ilayer%i%cactive%03irpcgas",istn+1,ily+1,cside,iMod+1);
-	  voActive = new TGeoVolume(activeName,shapeActive,RPCgasmedium);
-	  voActive->SetLineColor(kRed);
-	  
-	  //RPC Glass Front          
-          TGeoTrap* shapeRPCfront = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-         // TGeoBBox * shapeRPCfront = new TGeoBBox(dxx,dyy,dz);
-	  shapeRPCfront->SetName(Form("shStation%02iLayer%i%cModule%03iNoHoleFront", istn, ily, cside, iModule));
-	  TString NameFront = Form("muchstation%02ilayer%i%c%03irpcglassFront",istn+1,ily+1,cside,iMod+1);
-	  voRPCFront = new TGeoVolume(NameFront,shapeRPCfront,RPCglassmat);
-	  voRPCFront->SetLineColor(kRed);
-	  
-	  //RPC Glass Back
-          TGeoTrap* shapeRPCback = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-          //TGeoBBox * shapeRPCback = new TGeoBBox(dxx,dyy,dz);
-	  shapeRPCback->SetName(Form("shStation%02iLayer%i%cModule%03iNoHoleback", istn, ily, cside, iModule));
-	  TString Nameback = Form("muchstation%02ilayer%i%c%03irpcglassback",istn+1,ily+1,cside,iMod+1);
-	  voRPCback = new TGeoVolume(Nameback,shapeRPCback,RPCglassmat);
-	  voRPCback->SetLineColor(kRed);
-      
-//---------------------------------------------------------Drift & PCB's---------------------------------------------------------------     
-      
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftRpc[2], *G10Rpc[2];
-      
-      for(int iPos =0; iPos<2; iPos++){
-	Char_t cpos  = (iPos==0) ? 'i' : 'o'; 
-	
-	    DriftRpc[iPos] = new TGeoTrap(dz_sD,0,phi,dy+1.,dx1+1.,dx2+1.,0,dy+1.,dx1+1.,dx2+1.,0);
-	    G10Rpc[iPos] = new TGeoTrap(dz_sG,0,phi,dy+1.,dx1+1.,dx2+1.,0,dy+1.,dx1+1.,dx2+1.,0);
-	    DriftRpc[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule,cpos));
-	    DriftName[iPos] = Form("muchstation%02ilayer%i%cside%03i%ccopperDrift",istn+1,ily+1,cside,iMod+1,cpos);
-	    G10Rpc[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule,cpos));
-	    G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10",istn+1,ily+1,cside,iMod+1,cpos);
-	    voDrift[iPos] = new TGeoVolume(DriftName[iPos],DriftRpc[iPos],copperplate);
-	    voDrift[iPos]->SetLineColor(kRed);
-	    voG10[iPos] = new TGeoVolume(G10Name[iPos],G10Rpc[iPos],g10plate);
-	    voG10[iPos]->SetLineColor(3);
-	  
-      }
-
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame 
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,phi,dy+1.,dx1+1.,dx2+1.,0,dy+1.,dx1+1.,dx2+1.,0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-      TGeoTrap* shapeFrame1 = new TGeoTrap(sdz+.0001,0,phi,dy,dx1,dx2,0,dy,dx1,dx2,0);
-      shapeFrame1->SetName(Form("shStation%02iLayer%i%cModule%03iActiveVol", istn, ily, cside, iModule));
-      
-         
-     
-      TString expression;
-	  expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%02iLayer%i%cModule%03iActiveVol", istn, ily, cside, iModule, istn, ily, cside, iModule);
-        
-      
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%cframe%03i",istn+1,ily+1,cside,iMod+1);
-      
-      TGeoVolume* voFrame;
-      
-	  voFrame = new TGeoVolume(frameName,shFrame,SpacerRpc);  // Frame For RPC
-          voFrame->SetLineColor(kRed);
-      
-
-//----------------------------------------------Box -------------------------------------------
-       Double_t placeBox[3]={0.,0.,-0.5};
-       TGeoBBox * RpcBox1 = new TGeoBBox(dxx,dyy,dzz);
-       RpcBox1->SetName(Form("shStation%02iLayer%i%cModule%03iRpcBox1", istn, ily, cside, iModule));
-
-       TGeoBBox * RpcBox2 = new TGeoBBox(dxx-.3,dyy-.3,dzz-.5/2.,placeBox);
-       RpcBox2->SetName(Form("shStation%02iLayer%i%cModule%03iRpcBox2", istn, ily, cside, iModule));
-
-       TString expressionBox;
-       expressionBox = Form("shStation%02iLayer%i%cModule%03iRpcBox1-shStation%02iLayer%i%cModule%03iRpcBox2", istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-
-       TGeoCompositeShape* shBox = new TGeoCompositeShape(Form("shStation%02iLayer%i%cModule%03iFinalBox", istn, ily, cside, iModule), expressionBox);
-      TString BoxName = Form("muchstation%02ilayer%i%cBox%03i",istn+1,ily+1,cside,iMod+1);
-      
-      TGeoVolume* voBox;
-      voBox = new TGeoVolume(BoxName,shBox,SpacerRpc);  // Box For RPC
-      voBox->SetLineColor(kMagenta);
-      voBox->SetTransparency(2);
-      //----------------------------------------------------Placement----------------------------------------------------------------------  
-      // Calculate the phi angle of the sector where it has to be placed 
-      Double_t angle = 180.0-(180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-      // displace RPC module along the TOF frame
-      Double_t YOffset =  0.0;
-      Double_t ZOffset = -0.5;
-      
-      Double_t displacement_along_angle = -8.5; // -50.0; // cm for Carbon-12 run
-      Double_t module_rotation_angle    = -2.0; // degrees
-      
-      YOffset += displacement_along_angle *cos( module_rotation_angle * acos(-1)/180 );
-      ZOffset += displacement_along_angle *sin( module_rotation_angle * acos(-1)/180 );
-
-      // RPC backside at 0 degrees z = 237.5
-      //    y = -46.5 cm ... 76.5 cm -> 123 cm size in y
-      // -8.5 = -46.5 cm ... 76.5 cm displacement
-      //      100 *cos( -20 * acos(-1)/180 )
-      //      100 *sin( -20 * acos(-1)/180 )
-      // end of displacement along the rails
-      
-      TGeoRotation *r2 = new TGeoRotation("r2");
-      //rotate in the vertical plane (per to z axis) with angle 
-      r2->RotateZ(0);
-   //   cout<<RpcAwayBeamAxisY<<"     "<<BoxAwayBeamAxisY<<endl;
-      TGeoTranslation *trans[10];
-      TGeoHMatrix *incline_mod[10]; 
-      
-      TGeoTranslation *transBox = new TGeoTranslation("",posBox[0],posBox[1]+YOffset,pos[2]+ZOffset);
-      //      TGeoTranslation *transBox = new TGeoTranslation("",posBox[0],posBox[1],pos[2]);
-      TGeoHMatrix *incline_modBox = new TGeoHMatrix("");
-	(*incline_modBox) =  (*transBox) * (*r2);
-	// incline_modBox->RotateX(-2.);
-	incline_modBox->RotateX(module_rotation_angle);//sroy
-	
-      for(int i=0; i<8; i++){
-	trans[i] = new TGeoTranslation("",pos[0],pos[1]+YOffset,pos[i+2]+ZOffset);
-	//	trans[i] = new TGeoTranslation("",pos[0],pos[1],pos[i+2]);
-       
-	incline_mod[i] = new TGeoHMatrix("");
-	(*incline_mod[i]) =  (*trans[i]) * (*r2);  
-	// incline_mod[i]->RotateX(-2.);
-	incline_mod[i]->RotateX(module_rotation_angle);//sroy
-
-      }
-   
-      volayer->AddNode(voBox, iMod, incline_modBox); // add box volume 
-      volayer->AddNode(voActive, iMod, incline_mod[0]); // add active volume 
-     // volayer->AddNode(voFrame, iMod, incline_mod[0]);  // add spacer
-      volayer->AddNode(voRPCFront, iMod, incline_mod[1]); //Rpc Glass In
-      volayer->AddNode(voRPCback, iMod, incline_mod[2]); //Rpc Glass Out 
-     
-      volayer->AddNode(voDrift[0], iMod, incline_mod[3]); //Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[4]); //Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[5]); //G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[6]); //G10 Out
-   //   volayer->AddNode(voCool, iMod, incline_mod[7]); // Al Cooling Plate  
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-     muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[istn], istn, ily, iSide, iModule, Position, dx1,
-                                                     dx2,  dy,  dz, muchSt->GetRmin()));
-cout<<"stn: "<<istn<<"   module: "<<iModule<<endl;
-    }
-  }  
-  
-  return volayer;
-
-
-
-
-}
diff --git a/macro/mcbm/geometry/much/create_MUCH_geometry_v22f_mcbm.C b/macro/mcbm/geometry/much/create_MUCH_geometry_v22f_mcbm.C
deleted file mode 100644
index e49502ef72..0000000000
--- a/macro/mcbm/geometry/much/create_MUCH_geometry_v22f_mcbm.C
+++ /dev/null
@@ -1,767 +0,0 @@
-/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Omveer Singh, Shreya Roy, Florian Uhlig [committer] */
-
-/*** @author Omveer Singh <omvir.ch@gmail.com>
- ** @date 17 May 2020
- ** For more details see info file*/
-
-// clang-format off
-
-#include "TClonesArray.h"
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoBBox.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TObjArray.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <stdexcept>
-
-
-TObjArray* fStations = new TObjArray();
-CbmMuchStation* muchSt;
-CbmMuchLayer* muchLy;
-CbmMuchLayerSide* muchLySd;
-
-// Name of output file with geometry
-const TString tagVersion = "_v22f";
-//const TString subVersion   = "_sis100_1m_lmvm";
-const TString geoVersion   = "much";  // + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + tagVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + tagVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + tagVersion + "_mcbm.geo.info";
-const TString FileNamePar  = geoVersion + tagVersion + "_mcbm.par.root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString activemedium        = "MUCHargon";
-const TString spacermedium        = "MUCHnoryl";
-const TString Al                  = "aluminium";  //Al for cooling & support purpose
-const TString copper              = "copper";
-const TString g10                 = "G10";
-const TString RPCm= "RPCgas";
-const TString RPCg= "RPCglass";
-
-// Input parameters for MUCH stations
-//********************************************
-
-const Int_t fNst = 3;  // Number of stations
-Double_t TOF_Z_Front_Stand = 244.5;  // this is the TOF box front
-//Double_t TOF_Z_Front_Stand = 247.;  // this is the TOF RPC front
-Double_t RpcDistanceFromTof = 7.+1.9;  // add half thickness of RPC - gap is between backside of RPC and front of TOF
-//Double_t RpcDistanceFromTof = 7.;
-Double_t RpcPositionZ = TOF_Z_Front_Stand - RpcDistanceFromTof;
-Int_t fNlayers         = 1;               // Number of layers
-Double_t fLayersZ0[fNst]  = {75.7, 108.7, RpcPositionZ};   // Layers Positions
-//Double_t fLayersZ0[fNst]  = {65.7, 88.7, RpcPositionZ};   // Layers Positions
-Int_t fDetType[fNst]      = {3, 3, 4};          // Detector type
-Double_t fSupportLz[fNst] = {1., 1., 0};        // (cooling + support)
-Double_t fDriftDz      = 0.0035;          //35 micron copper Drift
-Double_t fG10Dz        = 0.30;            // 3 mm G10
-
-Double_t fActiveLzSector[fNst] = {0.3, 0.3, 0.2};  // Active volume thickness [cm]
-Double_t fFrameLzSector[fNst]  = {.3, .3, .6};    // Frame thickness [cm]
-Double_t fRpcGlassDz[fNst] = {0.0,0.0,0.2}; //Rpc Glass thickness [cm]
-Double_t fSpacerPhi         = 2.0;         // Spacer width in Phi [cm]
-Double_t fOverlapR          = 2.0;         // Overlap in R direction [cm]
-Double_t fSpacerR1          = 2.8;         // Spacer width in R at low Z[cm]
-Double_t fSpacerR2          = 3.5;         // Spacer width in R at high Z[cm]
-
-//Size of Modules
-//GEM
-Double_t dy  = 40.0;
-Double_t dx1 = 3.75;
-Double_t dx2 = 20;
-
-
-//RPC
-Double_t dyR  = 116.13/2.; 
-Double_t dx1R = 10.26/2.;
-Double_t dx2R = 50.98/2.;
-
-//box size
-Double_t dxx  = 74.0/2. ; 
-Double_t dyy = 123.0/2.;
-Double_t dzz = 3.8/2.;
-
-
-Double_t DetectorAxisHeight = 200.; //reference ground
-Double_t BoxBaseHeight = 153.5 ;
-Double_t BoxCentreHeight = BoxBaseHeight + dyy;
-Double_t BoxAwayBeamAxisY = BoxCentreHeight - DetectorAxisHeight;
-
-
-Double_t RpcBaseHeight = BoxBaseHeight + 4.5 ;
-Double_t RpcCentreHeight = RpcBaseHeight + dyR;
-Double_t RpcAwayBeamAxisY = RpcCentreHeight - DetectorAxisHeight;
-
-//Position of Box
-Double_t posBox[]={0,BoxAwayBeamAxisY}; //from the detector axis
-
-
-Double_t fX[fNst]         = {7.2, 7.2, 0.};      //Placement of modules in X [cm]
-Double_t fY[fNst]         = {24.53, 24.53, RpcAwayBeamAxisY};  //Placement of modules in Y [cm]
-
-//***********************************************************
-
-// some global variables
-TGeoManager* gGeoMan = NULL;         // Pointer to TGeoManager instance
-TGeoVolume* gModules_station[fNst];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* CreateStations(int ist);
-TGeoVolume* CreateLayersGem(int istn, int ily);
-TGeoVolume* CreateLayersRpc(int istn, int ily);
-
-
-fstream infoFile;
-void create_MUCH_geometry_v22f_mcbm()
-{
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = FileNameSim;
-  infoFileName.ReplaceAll("root", "info");
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "MUCH geometry created with create_MUCH_geometry_v22f_mcbm.C" << endl << endl;
-  infoFile << "Build a mMUCH setup for mCBM with 2 GEM." << endl;
-  infoFile << "10 mm thick Al plates are used for support and cooling in the "
-              "GEM modules."
-           << endl;
-  infoFile << "Drift and read-out PCBs (copper coated G10 plates) inserted for "
-              "realistic material budget for both GEM and RPC modules."
-           << endl
-           << endl;
-  infoFile << "No of Modules: " << fNlayers << "      ( GEM )" << endl;
-  infoFile << "Position of Modules Z [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fLayersZ0[i] << "    ";
-
-  infoFile << endl << endl << "Placement of Modules:" << endl;
-  infoFile << "Module"
-           << "\t"
-           << "X [cm]"
-           << "\t"
-           << "Y [cm]"
-           << "\t" << endl;
-  infoFile << "----------------------" << endl;
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << " " << i + 1 << "\t" << fX[i] << "\t" << fY[i] << endl;
-  infoFile << "----------------------" << endl;
-  infoFile << endl << "Al Cooling Plate Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fSupportLz[i] << "    ";
-
-  infoFile << endl << "Active Volume Thickness [cm]: ";
-  for (int i = 0; i < fNlayers; i++)
-    infoFile << fActiveLzSector[i] << "    ";
-
-  infoFile << endl << endl << endl << " GEM Module:" << endl;
-  infoFile << "                " << 2 * dx1 << " cm" << endl;
-  infoFile << "               .........                 |" << endl;
-  infoFile << "              ...........                |" << endl;
-  infoFile << "             .............               |" << endl;
-  infoFile << "            ...............              |" << endl;
-  infoFile << "           .................             |" << endl;
-  infoFile << "          ...................            |" << endl;
-  infoFile << "         .....................           |" << endl;
-  infoFile << "        .......................         " << 2 * dy << " cm" << endl;
-  infoFile << "       .........................         |" << endl;
-  infoFile << "      ...........................        |" << endl;
-  infoFile << "     .............................       |" << endl;
-  infoFile << "    ...............................      |" << endl;
-  infoFile << "   .................................     |" << endl;
-  infoFile << "  ...................................    |" << endl;
-  infoFile << " .....................................   |" << endl;
-  infoFile << ".......................................  |" << endl;
-  infoFile << "                " << 2 * dx2 << " cm" << endl;
-  infoFile << endl;
-
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TString topName = geoVersion + tagVersion + "_mcbm";
-
-  TGeoVolume* much = new TGeoVolumeAssembly(topName);
-  top->AddNode(much, 1);
-
-  TGeoVolume* sttn = new TGeoVolumeAssembly("station");
-  much->AddNode(sttn, 1);
-
-
-  for (Int_t istn = 0; istn < fNst; istn++) {
-
-    Double_t stGlobalZ0 = fLayersZ0[istn];
-    muchSt              = new CbmMuchStation(istn, stGlobalZ0);
-    muchSt->SetRmin(0.);
-    muchSt->SetRmax(0.);
-    fStations->Add(muchSt);
-
-
-    gModules_station[istn] = CreateStations(istn);
-    sttn->AddNode(gModules_station[istn], istn);
-  }
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  much->Export(FileNameSim);  // an alternative way of writing the much
-
-  TFile* outfile                  = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* much_placement = new TGeoTranslation("much_trans", -6., 0., 0.);
-  much_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this if you want GeoManager format in the output
-  outfile->Close();
-
-  top->Draw("ogl");
-  infoFile.close();
-
-  TFile* parfile = new TFile(FileNamePar, "RECREATE");
-  fStations->Write("stations", 1);  // for geometry parameters
-  parfile->Close();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air = geoMedia->getMedium(KeepingVolumeMedium);
-  geoBuild->createMedium(air);
-
-  FairGeoMedium* MUCHargon = geoMedia->getMedium(activemedium);
-  geoBuild->createMedium(MUCHargon);
-
-  FairGeoMedium* MUCHnoryl = geoMedia->getMedium(spacermedium);
-  geoBuild->createMedium(MUCHnoryl);
-
-  FairGeoMedium* MUCHsupport = geoMedia->getMedium(Al);
-  geoBuild->createMedium(MUCHsupport);
-
-  FairGeoMedium* copperplate = geoMedia->getMedium(copper);
-  geoBuild->createMedium(copperplate);
-
-  FairGeoMedium* g10plate = geoMedia->getMedium(g10);
-  geoBuild->createMedium(g10plate);
-
-  FairGeoMedium* RPCmedium = geoMedia->getMedium(RPCm);
-  geoBuild->createMedium(RPCmedium);
-
-  FairGeoMedium* RPCmaterial = geoMedia->getMedium(RPCg);
-  geoBuild->createMedium(RPCmaterial);
-
-}
-
-TGeoVolume* CreateStations(int ist)
-{
-
-  TString stationName         = Form("muchstation%02i", ist + 1);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(stationName);  //, shStation, air);
-
-  TGeoVolume* gLayer[fNlayers + 1];
-  for (int ii = 0; ii < fNlayers; ii++) {  // 2 Layers
-
-   // Double_t sideDz = fSupportLz[istn] / 2. + fActiveLzSector[istn] / 2.;  // distance between side's and layer's centers
-
-    muchLy = new CbmMuchLayer(ist, ii, fLayersZ0[ist], 0.);
-    muchSt->AddLayer(muchLy);
-    muchLy->GetSideF()->SetZ(fLayersZ0[ist] );  
-
-
- if(ist<2)gLayer[ii] = CreateLayersGem(ist, ii);
-   else gLayer[ii] = CreateLayersRpc(ist, ii);
-    station->AddNode(gLayer[ii], ii);
-  }
-
-  return station;
-}
-
-TGeoVolume* CreateLayersGem(int istn, int ily)
-{
-
-  TString layerName = Form("muchstation%02ilayer%i", istn + 1, ily + 1);
-
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[istn] / 2.;
-  Double_t driftDz   = fActiveLzSector[istn] / 2 + fDriftDz / 2.;
-  Double_t g10Dz     = driftDz + fDriftDz / 2. + fG10Dz / 2.;
-
-
-  Double_t moduleZ   = fLayersZ0[istn];
-  Double_t driftZIn  = moduleZ - driftDz;
-  Double_t driftZOut = moduleZ + driftDz;
-  Double_t g10ZIn    = moduleZ - g10Dz;
-  Double_t g10ZOut   = moduleZ + g10Dz;
-  Double_t cool_z    = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz = fActiveLzSector[istn] / 2.;  // Active Volume Thickness
-
-  Int_t Nsector = 16.0;
-  Double_t phi0 = TMath::Pi() / Nsector;  // azimuthal half widh of each module
-
-  //define the spacer dimensions
-  Double_t tg   = (dx2 - dx1) / 2 / dy;
-  Double_t dd1  = fSpacerPhi * tg;
-  Double_t dd2  = fSpacerPhi * sqrt(1 + tg * tg);
-  Double_t sdx1 = dx1 + dd2 - dd1;
-  Double_t sdx2 = dx2 + dd2 + dd1;
-  Double_t sdy1 = dy + fSpacerR1;  // frame width added
-  Double_t sdy2 = dy + fSpacerR2;  // frame width added
-  Double_t sdz  = fFrameLzSector[istn] / 2.;
-
-  //define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz / 2.;  //35 micron copper Drift
-  Double_t dz_sG = fG10Dz / 2.;    // 3mm G10
-  Double_t sdy   = sdy2;
-
-
-  Double_t pos[10];
-
-  Int_t iMod = 0;
-  for (Int_t iSide = 0; iSide < 1; iSide++) {
-    //muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the GEM modules
-    for (Int_t iModule = 0; iModule < 1; iModule++) {
-
-      Double_t phi  = 0;  // add 0.5 to not overlap with y-axis for left-right layer separation
-      Bool_t isBack = iModule % 2;
-      Char_t cside  = (isBack == 1) ? 'b' : 'f';
-
-      // correct the x, y positions
-      pos[0] = fX[istn];
-      pos[1] = fY[istn];
-
-
-      // different z positions for odd/even modules
-      pos[2] = moduleZ;
-      pos[3] = driftZIn;
-      pos[4] = driftZOut;
-      pos[5] = g10ZIn;
-      pos[6] = g10ZOut;
-      pos[7] = cool_z;
-
-      if (iSide != isBack) continue;
-      if (iModule != 0) iMod = iModule / 2;
-
-      muchLySd = muchLy->GetSide(iSide);
-
-      TGeoMedium* argon       = gGeoMan->GetMedium(activemedium);  // active medium
-      TGeoMedium* noryl       = gGeoMan->GetMedium(spacermedium);  // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper);        // copper Drift medium
-      TGeoMedium* g10plate    = gGeoMan->GetMedium(g10);           // G10 medium
-      TGeoMedium* coolMat     = gGeoMan->GetMedium(Al);
-
-
-      // Define and place the shape of the modules
-      TGeoTrap* shapeGem = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeGem->SetName(Form("shStation%02iLayer%i%cModule%03iActiveGemNoHole", istn, ily, cside, iModule));
-
-      //------------------------------------------------------Al Cooling Plate--------------------------------------------------------------------
-      TGeoVolume* voActive;
-      TGeoTrap* coolGem;
-      TGeoVolume* voCool;
-
-      coolGem = new TGeoTrap(SupportDz, 0, phi, sdy2, sdx1, sdx2, 0, sdy2, sdx1, sdx2, 0);
-      coolGem->SetName(Form("shStation%02iLayer%i%cModule%03icoolGem", istn, ily, cside, iModule));
-      TString CoolName = Form("muchstation%02ilayer%i%ccoolGem%03iAluminum", istn + 1, ily + 1, cside, iModule + 1);
-      voCool           = new TGeoVolume(CoolName, coolGem, coolMat);
-      voCool->SetLineColor(kYellow);
-
-      //------------------------------------------------------Active Volume-----------------------------------------------------
-      //GEM
-      TGeoTrap* shapeActive = new TGeoTrap(dz, 0, 0, dy, dx1, dx2, 0, dy, dx1, dx2, 0);
-      shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-      TString activeName = Form("muchstation%02ilayer%i%cactive%03igasArgon", istn + 1, ily + 1, cside, iMod + 1);
-      voActive           = new TGeoVolume(activeName, shapeActive, argon);
-      voActive->SetLineColor(kGreen);
-
-
-      //---------------------------------------------------------Drift & PCB's---------------------------------------------------------------
-
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftGem[2], *G10Gem[2];
-
-      for (int iPos = 0; iPos < 2; iPos++) {
-        Char_t cpos    = (iPos == 0) ? 'i' : 'o';
-        DriftGem[iPos] = new TGeoTrap(dz_sD, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        G10Gem[iPos]   = new TGeoTrap(dz_sG, 0, phi, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-        DriftGem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule, cpos));
-        DriftName[iPos] =
-          Form("muchstation%02ilayer%i%cside%03i%ccopperDrift", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        G10Gem[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule, cpos));
-        G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10", istn + 1, ily + 1, cside, iMod + 1, cpos);
-        voDrift[iPos] = new TGeoVolume(DriftName[iPos], DriftGem[iPos], copperplate);
-        voDrift[iPos]->SetLineColor(kRed);
-        voG10[iPos] = new TGeoVolume(G10Name[iPos], G10Gem[iPos], g10plate);
-        voG10[iPos]->SetLineColor(28);
-      }
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz, 0, 0, sdy, sdx1, sdx2, 0, sdy, sdx1, sdx2, 0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-
-      TString expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%"
-                                "02iLayer%i%cModule%03iActiveGemNoHole",
-                                istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(
-        Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%csupport%03i", istn + 1, ily + 1, cside, iMod + 1);
-
-      TGeoVolume* voFrame = new TGeoVolume(frameName, shFrame, noryl);  // Frame for GEM
-      voFrame->SetLineColor(kMagenta);
-
-
-      //----------------------------------------------------Placement----------------------------------------------------------------------
-      // Calculate the phi angle of the sector where it has to be placed
-      Double_t angle = 180.0 - (180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-
-      TGeoRotation* r2 = new TGeoRotation("r2");
-      //rotate in the vertical plane (per to z axis) with angle
-      r2->RotateZ(angle);
-
-
-      TGeoTranslation* trans[10];
-      TGeoHMatrix* incline_mod[10];
-
-      for (int i = 0; i < 6; i++) {
-        trans[i] = new TGeoTranslation("", pos[0], pos[1], pos[i + 2]);  // shift GEMs in x, y, z here
-
-        incline_mod[i]    = new TGeoHMatrix("");
-        (*incline_mod[i]) = (*trans[i]) * (*r2);
-      }
-
-      volayer->AddNode(voFrame, iMod, incline_mod[0]);     // add spacer
-      volayer->AddNode(voActive, iMod, incline_mod[0]);    // add active volume
-      volayer->AddNode(voDrift[0], iMod, incline_mod[1]);  //Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[2]);  //Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[3]);    //G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[4]);    //G10 Out
-      volayer->AddNode(voCool, iMod, incline_mod[5]);      // Al Cooling Plate
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-     muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[istn], istn, ily, iSide, iModule, Position, dx1,
-                                                     dx2,  dy,  dz, muchSt->GetRmin()));
-cout<<"stn: "<<istn<<"   module: "<<iModule<<endl;
-    }
-  }
-
-  return volayer;
-}
-
-TGeoVolume* CreateLayersRpc(int istn, int ily){
-
- 
- TString layerName;
- 
-   layerName = Form("muchstation%02ilayerRpc%i",istn+1,ily+1);
-  
-
-  TGeoVolumeAssembly* volayer = new TGeoVolumeAssembly(layerName);
-
-  Double_t SupportDz = fSupportLz[istn]/2.;
-  Double_t RpcGlassDz = fActiveLzSector[istn]/2. + fRpcGlassDz[istn]/2.;
-  Double_t driftDz = RpcGlassDz + fRpcGlassDz[istn]/2 + fDriftDz/2.;
-  Double_t g10Dz = driftDz + fDriftDz/2. + fG10Dz/2.;
-  Double_t FrameRpcDz = fActiveLzSector[istn]/2. + fRpcGlassDz[istn] + fDriftDz + g10Dz + fG10Dz;
-  
-  Double_t moduleZ = fLayersZ0[istn]; 
-  Double_t RpcGlassZIn = moduleZ - RpcGlassDz;
-  Double_t RpcGlassZOut = moduleZ + RpcGlassDz;
-  Double_t driftZIn = moduleZ - driftDz; 
-  Double_t driftZOut = moduleZ + driftDz; 
-  Double_t g10ZIn = moduleZ - g10Dz;
-  Double_t g10ZOut = moduleZ + g10Dz;
- // Double_t cool_z = g10ZOut + fG10Dz/2. + SupportDz;
-  Double_t cool_z = g10ZIn - fG10Dz / 2. - SupportDz;
-
-  Double_t dz  = fActiveLzSector[istn]/2.; // Active Volume Thickness 
-  
-  Int_t Nsector=16.0;
-  Double_t phi0 = TMath::Pi()/Nsector; // azimuthal half widh of each module
-
-  dx1 = dx1R; dx2 = dx2R; dy = dyR;
-  //define the spacer dimensions      
-  Double_t tg = (dx2-dx1)/2/dy;
-  Double_t dd1 = fSpacerPhi*tg;
-  Double_t dd2 = fSpacerPhi*sqrt(1+tg*tg);
-  Double_t sdx1 = dx1+dd2-dd1;
-  Double_t sdx2 = dx2+dd2+dd1; 
-  Double_t sdy1  = dy+fSpacerR1; // frame width added 
-  Double_t sdy2  = dy+fSpacerR2; // frame width added
-  Double_t sdz = fFrameLzSector[istn]/2.;
-  
-  //define Additional material as realistic GEM module
-  Double_t dz_sD = fDriftDz/2.; //35 micron copper Drift 
-  Double_t dz_sG = fG10Dz/2.; // 3mm G10
-  Double_t sdy = sdy2;
-  
-  
-  Double_t pos[10];
-  
-  Int_t iMod =0;
-  for (Int_t iSide=0;iSide<1;iSide++){
-     // muchLySd = muchLy->GetSide(iSide);
-    // Now start adding the Rpc modules  
-    for (Int_t iModule=0; iModule<1; iModule++){ 
-      
-      Double_t phi  = 0;  // add 0.5 to not overlap with y-axis for left-right layer separation
-      Bool_t isBack = iModule%2; 
-      Char_t cside  = (isBack==1) ? 'b' : 'f'; 
-      
-      // correct the x, y positions
-      pos[0] = fX[istn];   
-      pos[1] = fY[istn];
-      
-      
-      
-      // different z positions for odd/even modules
-      pos[2] = moduleZ ;
-      pos[3] = RpcGlassZIn;
-      pos[4] = RpcGlassZOut;
-      pos[5] = driftZIn;
-      pos[6] = driftZOut;
-      pos[7] = g10ZIn;
-      pos[8] = g10ZOut;
-      pos[9] = cool_z;
-      
-      if(iSide!=isBack)continue;
-      if(iModule!=0)iMod =iModule/2;
-      
-      muchLySd = muchLy->GetSide(iSide);  
-    
-
-      TGeoMedium* SpacerRpc = gGeoMan->GetMedium(Al); // spacer medium
-      TGeoMedium* copperplate = gGeoMan->GetMedium(copper); // copper Drift medium
-      TGeoMedium* g10plate = gGeoMan->GetMedium(g10); // G10 medium
-      TGeoMedium*  RPCglassmat = gGeoMan->GetMedium(RPCg); // RPC Glass
-      TGeoMedium*  RPCgasmedium = gGeoMan->GetMedium(RPCm); // RPC Gas
-      TGeoMedium* coolMat = gGeoMan->GetMedium(Al);
-      
-
-      TGeoTrap* shapeRpc = new TGeoTrap(sdz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-     // TGeoBBox * shapeRpc = new TGeoBBox(dxx,dyy,FrameRpcDz);
-      shapeRpc->SetName(Form("shStation%02iLayer%i%cModule%03iActiveRpcNoHole", istn, ily, cside, iModule));
-      
-      //------------------------------------------------------Al Cooling Plate--------------------------------------------------------------------
-      TGeoVolume* voActive, *voRPCback, *voRPCFront;      
-      TGeoTrap * coolRpc;
-      TGeoVolume* voCool;
-   
-	coolRpc = new TGeoTrap(SupportDz,0,phi,sdy2,sdx1,sdx2,0,sdy2,sdx1,sdx2,0);
-	coolRpc->SetName(Form("shStation%02iLayer%i%cModule%03icoolRpc", istn, ily, cside, iModule));
-	TString CoolName = Form("muchstation%02ilayer%i%ccoolRpc%03iAluminum",istn+1,ily+1,cside,iModule+1);
-	voCool = new TGeoVolume(CoolName,coolRpc,coolMat);
-	voCool->SetLineColor(kYellow);
-     
-      
-      
-      //------------------------------------------------------Active Volume & Rpc Glass----------------------------------------------------- 
- 
-          //RPC Active
-          TGeoTrap* shapeActive = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-          shapeActive->SetName(Form("shStation%02iLayer%i%cModule%03iActiveNoHole", istn, ily, cside, iModule));
-	  TString activeName = Form("muchstation%02ilayer%i%cactive%03irpcgas",istn+1,ily+1,cside,iMod+1);
-	  voActive = new TGeoVolume(activeName,shapeActive,RPCgasmedium);
-	  voActive->SetLineColor(kRed);
-	  
-	  //RPC Glass Front          
-          TGeoTrap* shapeRPCfront = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-         // TGeoBBox * shapeRPCfront = new TGeoBBox(dxx,dyy,dz);
-	  shapeRPCfront->SetName(Form("shStation%02iLayer%i%cModule%03iNoHoleFront", istn, ily, cside, iModule));
-	  TString NameFront = Form("muchstation%02ilayer%i%c%03irpcglassFront",istn+1,ily+1,cside,iMod+1);
-	  voRPCFront = new TGeoVolume(NameFront,shapeRPCfront,RPCglassmat);
-	  voRPCFront->SetLineColor(kRed);
-	  
-	  //RPC Glass Back
-          TGeoTrap* shapeRPCback = new TGeoTrap(dz,0,0,dy,dx1,dx2,0,dy,dx1,dx2,0);
-          //TGeoBBox * shapeRPCback = new TGeoBBox(dxx,dyy,dz);
-	  shapeRPCback->SetName(Form("shStation%02iLayer%i%cModule%03iNoHoleback", istn, ily, cside, iModule));
-	  TString Nameback = Form("muchstation%02ilayer%i%c%03irpcglassback",istn+1,ily+1,cside,iMod+1);
-	  voRPCback = new TGeoVolume(Nameback,shapeRPCback,RPCglassmat);
-	  voRPCback->SetLineColor(kRed);
-      
-//---------------------------------------------------------Drift & PCB's---------------------------------------------------------------     
-      
-      TString DriftName[2], G10Name[2], AlName;
-      TGeoVolume *voDrift[2], *voG10[2];
-      TGeoTrap *DriftRpc[2], *G10Rpc[2];
-      
-      for(int iPos =0; iPos<2; iPos++){
-	Char_t cpos  = (iPos==0) ? 'i' : 'o'; 
-	
-	    DriftRpc[iPos] = new TGeoTrap(dz_sD,0,phi,dy+1.,dx1+1.,dx2+1.,0,dy+1.,dx1+1.,dx2+1.,0);
-	    G10Rpc[iPos] = new TGeoTrap(dz_sG,0,phi,dy+1.,dx1+1.,dx2+1.,0,dy+1.,dx1+1.,dx2+1.,0);
-	    DriftRpc[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cDrift", istn, ily, cside, iModule,cpos));
-	    DriftName[iPos] = Form("muchstation%02ilayer%i%cside%03i%ccopperDrift",istn+1,ily+1,cside,iMod+1,cpos);
-	    G10Rpc[iPos]->SetName(Form("shStation%02iLayer%i%cModule%03i%cG10", istn, ily, cside, iModule,cpos));
-	    G10Name[iPos] = Form("muchstation%02ilayer%i%cside%03i%cG10",istn+1,ily+1,cside,iMod+1,cpos);
-	    voDrift[iPos] = new TGeoVolume(DriftName[iPos],DriftRpc[iPos],copperplate);
-	    voDrift[iPos]->SetLineColor(kRed);
-	    voG10[iPos] = new TGeoVolume(G10Name[iPos],G10Rpc[iPos],g10plate);
-	    voG10[iPos]->SetLineColor(3);
-	  
-      }
-
-      //------------------------------------------------------------Frame-----------------------------------------------------------------
-      // Define the trapezoidal Frame 
-      TGeoTrap* shapeFrame = new TGeoTrap(sdz,0,phi,dy+1.,dx1+1.,dx2+1.,0,dy+1.,dx1+1.,dx2+1.,0);
-      shapeFrame->SetName(Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole", istn, ily, cside, iModule));
-
-      TGeoTrap* shapeFrame1 = new TGeoTrap(sdz+.0001,0,phi,dy,dx1,dx2,0,dy,dx1,dx2,0);
-      shapeFrame1->SetName(Form("shStation%02iLayer%i%cModule%03iActiveVol", istn, ily, cside, iModule));
-      
-         
-     
-      TString expression;
-	  expression = Form("shStation%02iLayer%i%cModule%03iFullFrameGemNoHole-shStation%02iLayer%i%cModule%03iActiveVol", istn, ily, cside, iModule, istn, ily, cside, iModule);
-        
-      
-      TGeoCompositeShape* shFrame = new TGeoCompositeShape(Form("shStation%02iLayer%i%cModule%03iFinalFrameNoHole", istn, ily, cside, iModule), expression);
-      TString frameName = Form("muchstation%02ilayer%i%cframe%03i",istn+1,ily+1,cside,iMod+1);
-      
-      TGeoVolume* voFrame;
-      
-	  voFrame = new TGeoVolume(frameName,shFrame,SpacerRpc);  // Frame For RPC
-          voFrame->SetLineColor(kRed);
-      
-
-//----------------------------------------------Box -------------------------------------------
-       Double_t placeBox[3]={0.,0.,-0.5};
-       TGeoBBox * RpcBox1 = new TGeoBBox(dxx,dyy,dzz);
-       RpcBox1->SetName(Form("shStation%02iLayer%i%cModule%03iRpcBox1", istn, ily, cside, iModule));
-
-       TGeoBBox * RpcBox2 = new TGeoBBox(dxx-.3,dyy-.3,dzz-.5/2.,placeBox);
-       RpcBox2->SetName(Form("shStation%02iLayer%i%cModule%03iRpcBox2", istn, ily, cside, iModule));
-
-       TString expressionBox;
-       expressionBox = Form("shStation%02iLayer%i%cModule%03iRpcBox1-shStation%02iLayer%i%cModule%03iRpcBox2", istn, ily, cside, iModule, istn, ily, cside, iModule);
-
-
-       TGeoCompositeShape* shBox = new TGeoCompositeShape(Form("shStation%02iLayer%i%cModule%03iFinalBox", istn, ily, cside, iModule), expressionBox);
-      TString BoxName = Form("muchstation%02ilayer%i%cBox%03i",istn+1,ily+1,cside,iMod+1);
-      
-      TGeoVolume* voBox;
-      voBox = new TGeoVolume(BoxName,shBox,SpacerRpc);  // Box For RPC
-      voBox->SetLineColor(kMagenta);
-      voBox->SetTransparency(2);
-      //----------------------------------------------------Placement----------------------------------------------------------------------  
-      // Calculate the phi angle of the sector where it has to be placed 
-      Double_t angle = 180.0-(180. / TMath::Pi() * phi0);  // convert angle phi from rad to deg
-
-      // displace RPC module along the TOF frame
-      Double_t XOffset = 0;
-      Double_t ZOffset = -6.4;
-      
-      Double_t displacement_along_rails     = -50.0; // cm for Carbon-12 run
-      Double_t support_frame_rotation_angle =  12.5; // degrees
-      
-      XOffset += +displacement_along_rails *cos( support_frame_rotation_angle * acos(-1)/180 );
-      ZOffset += -displacement_along_rails *sin( support_frame_rotation_angle * acos(-1)/180 );
-      // end of displacement along the rails
-      
-      TGeoRotation *r2 = new TGeoRotation("r2");
-      //rotate in the vertical plane (per to z axis) with angle 
-      r2->RotateZ(0);
-      //      r2->RotateX(2);
-   //   cout<<RpcAwayBeamAxisY<<"     "<<BoxAwayBeamAxisY<<endl;
-      TGeoTranslation *trans[10];
-      TGeoHMatrix *incline_mod[10]; 
-      
-      TGeoTranslation *transBox = new TGeoTranslation("",posBox[0]+XOffset,posBox[1],pos[2]+ZOffset);
-      //      TGeoTranslation *transBox = new TGeoTranslation("",posBox[0],posBox[1],pos[2]);
-      TGeoHMatrix *incline_modBox = new TGeoHMatrix("");
-	(*incline_modBox) =  (*transBox) * (*r2);
-	// incline_modBox->RotateX(-2.);
-	incline_modBox->RotateY(support_frame_rotation_angle);//sroy
-	
-      for(int i=0; i<8; i++){
-	trans[i] = new TGeoTranslation("",pos[0]+XOffset,pos[1],pos[i+2]+ZOffset);
-	//	trans[i] = new TGeoTranslation("",pos[0],pos[1],pos[i+2]);
-       
-	incline_mod[i] = new TGeoHMatrix("");
-	(*incline_mod[i]) =  (*trans[i]) * (*r2);  
-	// incline_mod[i]->RotateX(-2.);
-	incline_mod[i]->RotateY(support_frame_rotation_angle);//sroy
-
-      }
-   
-      volayer->AddNode(voBox, iMod, incline_modBox); // add box volume 
-      volayer->AddNode(voActive, iMod, incline_mod[0]); // add active volume 
-     // volayer->AddNode(voFrame, iMod, incline_mod[0]);  // add spacer
-      volayer->AddNode(voRPCFront, iMod, incline_mod[1]); //Rpc Glass In
-      volayer->AddNode(voRPCback, iMod, incline_mod[2]); //Rpc Glass Out 
-     
-      volayer->AddNode(voDrift[0], iMod, incline_mod[3]); //Drift In
-      volayer->AddNode(voDrift[1], iMod, incline_mod[4]); //Drift Out
-      volayer->AddNode(voG10[0], iMod, incline_mod[5]); //G10 In
-      volayer->AddNode(voG10[1], iMod, incline_mod[6]); //G10 Out
-   //   volayer->AddNode(voCool, iMod, incline_mod[7]); // Al Cooling Plate  
-
-      TVector3 Position;
-      Position.SetXYZ(pos[0], pos[1], pos[2]);
-      cout << pos[2] << "   " << pos[3] << "   " << pos[4] << "   " << pos[5] << "   " << pos[6] << "   " << pos[7]
-           << endl;
-     muchLySd->AddModule(new CbmMuchModuleGemRadial(fDetType[istn], istn, ily, iSide, iModule, Position, dx1,
-                                                     dx2,  dy,  dz, muchSt->GetRmin()));
-cout<<"stn: "<<istn<<"   module: "<<iModule<<endl;
-    }
-  }  
-  
-  return volayer;
-
-
-
-
-}
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18a.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18a.C
deleted file mode 100644
index 43b01f7488..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18a.C
+++ /dev/null
@@ -1,374 +0,0 @@
-/* Copyright (C) 2014-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Andrey Chernogorov, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v18a.C
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 04.06.2014
- **
- ** SIS-100
- ** pipe_v18a = pipe_v14f + fixed sizes of vacuum chamber for mvd_v14a
- **
- ** The beam pipe is composed of aluminium with a thickness proportional to the
- ** diameter (D(z)mm/60). It is placed directly into the cave as mother volume.
- ** The beam pipe consists of few sections excluding RICH section(1700-3700mm) 
- ** because it is part of the RICH geometry. Each section has a PCON shape 
- ** (including windows). There are two windows: first one @ 220mm with R600mm 
- ** and 0.7mm thickness, second one of iron @ 6000mm with R600mm and 0.2mm 
- ** thickness. The STS section is composed of cylinder D(z=220-500mm)=36mm and 
- ** cone (z=500-1700mm). All sections of the beam pipe with conical shape have 
- ** half opening angle 2.5deg. The PSD section of the beam pipe is missing 
- ** because it is planned that it will be part of PSD geometry.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "aluminium";  // "beryllium" "carbon"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macros name to info file
-TString macrosname = "create_bpipe_geometry_v18a.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v18a.root";
-// ---> Geometry name
-TString pipeName = "pipe_v18a";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v18a()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v18a:   **/
-  TString pipe1name         = "pipe1 - vacuum chamber";
-  const Int_t nSects1       = 6;
-  Double_t z1[nSects1]      = {-50., -5., -5., 230.17, 230.17, 230.87};  // mm
-  Double_t rin1[nSects1]    = {25., 25., 400., 400., 110., 110.};
-  Double_t rout1[nSects1]   = {25.7, 25.7, 400.7, 400.7, 400.7, 130.7};
-  TString pipe2name         = "pipe2 - first window @ 220mm, h=0.7mm, R=600mm";
-  const Int_t nSects2       = 7;
-  Double_t z2[nSects2]      = {220., 220.7, 221.45, 223.71, 227.49, 230.17, 230.87};  // mm
-  Double_t rin2[nSects2]    = {18., 18., 30., 60., 90., 105.86, 110.};
-  Double_t rout2[nSects2]   = {18., 28.69, 39.3, 65.55, 94.14, 110., 110.};
-  TString pipevac1name      = "pipevac1";
-  const Int_t nSects01      = 10;
-  Double_t z01[nSects01]    = {-50., -5., -5., 220., 220., 220.7, 221.45, 223.71, 227.49, 230.17};  // mm
-  Double_t rin01[nSects01]  = {0., 0., 0., 0., 18., 28.69, 39.3, 65.55, 94.14, 110.};
-  Double_t rout01[nSects01] = {25., 25., 400., 400., 400., 400., 400., 400., 400., 400.};
-
-  TString pipe3name       = "pipe3 - STS section";
-  const Int_t nSects3     = 4;
-  Double_t z3[nSects3]    = {220., 500., 1250., 1700.};  // mm
-  Double_t rout3[nSects3] = {18., 18., 55., 74.2};
-  Double_t rin3[nSects3];
-  for (Int_t i = 0; i < nSects3; i++) {
-    rin3[i] = rout3[i] - rout3[i] / 30.;
-  }
-  TString pipevac2name     = "pipevac2";
-  const Int_t nSects02     = nSects3;
-  Double_t z02[nSects02]   = {220., 500., 1250., 1700.};  // mm
-  Double_t rin02[nSects02] = {0., 0., 0., 0.};
-  Double_t rout02[nSects02];
-  for (Int_t i = 0; i < nSects02; i++) {
-    rout02[i] = rin3[i];
-  }
-  /*
-  TString pipe4name = "pipe4 - RICH section";
-  const Int_t nSects4 = 2;
-  Double_t z4[nSects4]    = { 1800.,   3700.  }; // mm
-  Double_t rout4[nSects4] = {   74.2,   161.6 };
-  Double_t rin4[nSects4]; for(Int_t i=0; i<nSects4; i++) { rin4[i] = rout4[i] - rout4[i]/30.; }
-  TString pipevac3name = "pipevac3";
-  const Int_t nSects03 = nSects4;
-  Double_t z03[nSects03]    = { 1800.,   3700.   }; // mm
-  Double_t rin03[nSects03]  = {    0.,      0.   };
-  Double_t rout03[nSects03]; for(Int_t i=0; i<nSects03; i++) { rout03[i]=rin4[i]; }
-  //*/
-  TString pipe5name       = "pipe5 - TRD & TOF section";
-  const Int_t nSects5     = 3;
-  Double_t z5[nSects5]    = {3700., 5999.8, 6000.};  // mm
-  Double_t rout5[nSects5] = {161.6, 261.96, 262.};
-  Double_t rin5[nSects5]  = {156.2, 253.23, 253.27};
-  //Double_t rin5[nSects5]; for(Int_t i=0; i<nSects5; i++) { rin5[i] = rout5[i] - rout5[i]/30.; }
-
-  TString pipevac4name     = "pipevac4";
-  const Int_t nSects04     = 7;
-  Double_t z04[nSects04]   = {3700., 5943.24, 5943.44, 5947.34, 5959.8, 5981.19, 5999.8};  // mm
-  Double_t rin04[nSects04] = {0., 0., 3.42, 70., 140., 210., 253.23};
-  //Double_t rout04[nSects04] = {  156.2,   250.87,  250.88,  251.05,  251.57,  252.48,  253.23 };
-  Double_t rout04[nSects04] = {156.2, 250.84, 250.85, 251.01, 251.54, 252.44, 253.23};
-
-  TString pipe6name       = "pipe6 - second window @ 6000mm, h=0.2mm, R=600mm";  // iron !!!
-  const Int_t nSects6     = 7;
-  Double_t z6[nSects6]    = {5943.24, 5943.44, 5947.34, 5959.8, 5981.19, 5999.8, 6000.};  // mm
-  Double_t rin6[nSects6]  = {0., 0., 66.58, 138.88, 209.35, 252.28, 253.27};
-  Double_t rout6[nSects6] = {0., 3.42, 70., 140., 210., 253.23, 253.27};
-
-  // --------------------------------------------------------------------------
-
-  // -------------  Load the necessary FairRoot libraries   -------------------
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-100. Beam pipe geometry created with " + macrosname << endl << endl;
-  infoFile << "	  pipe_v18a = pipe_v14f + fixed sizes of vacuum chamber for "
-              "mvd_v14a"
-           << endl
-           << endl;
-  infoFile << " The beam pipe is composed of aluminium with a thickness "
-              "proportional to the"
-           << endl;
-  infoFile << " diameter (D(z)mm/60). It is placed directly into the cave as "
-              "mother volume."
-           << endl;
-  infoFile << " The beam pipe consists of few sections excluding RICH "
-              "section(1700-3700mm) "
-           << endl;
-  infoFile << " because it is part of the RICH geometry. Each section has a "
-              "PCON shape "
-           << endl;
-  infoFile << " (including windows). There are two windows: first one @ 220mm "
-              "with R600mm "
-           << endl;
-  infoFile << " and 0.7mm thickness, second one of iron @ 6000mm with R600mm "
-              "and 0.2mm "
-           << endl;
-  infoFile << " thickness. The STS section is composed of cylinder "
-              "D(z=220-500mm)=36mm and "
-           << endl;
-  infoFile << " cone (z=500-1700mm). All sections of the beam pipe with "
-              "conical shape have "
-           << endl;
-  infoFile << " half opening angle 2.5deg. The PSD section of the beam pipe is "
-              "missing "
-           << endl;
-  infoFile << " because it is planned that it will be part of PSD geometry." << endl << endl;
-
-  infoFile << "Material:  " << pipeMediumName << endl;
-  infoFile << "Thickness: D(z)mm/60" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-
-  TGeoVolume* pipe1 = MakePipe(1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
-  pipe1->SetLineColor(kGray);
-  pipe->AddNode(pipe1, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe2name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-  TGeoVolume* pipe2 = MakePipe(2, nSects2, z2, rin2, rout2, pipeMedium, &infoFile);
-  pipe2->SetLineColor(kBlue);
-  pipe->AddNode(pipe2, 0);
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  /*
-  infoFile << endl << "Beam pipe section: " << pipe3name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe3    = MakePipe  (3, nSects3,  z3,  rin3,  rout3,  pipeMedium, &infoFile); 
-  pipe3->SetLineColor(kGreen);
-  pipe->AddNode(pipe3, 0);
-  TGeoVolume* pipevac2 = MakeVacuum(2, nSects02, z02, rin02, rout02, vacuum,     &infoFile); 
-  pipevac2->SetLineColor(kCyan);
-  pipe->AddNode(pipevac2, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe4name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe4    = MakePipe  (4, nSects4,  z4,  rin4,  rout4,  pipeMedium, &infoFile); 
-  pipe4->SetLineColor(kGreen+2);
-  pipe->AddNode(pipe4, 0);
-  TGeoVolume* pipevac3 = MakeVacuum(3, nSects03, z03, rin03, rout03, vacuum,     &infoFile); 
-  pipevac3->SetLineColor(kCyan);
-  pipe->AddNode(pipevac3, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe5name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe5    = MakePipe  (5, nSects5,  z5,  rin5,  rout5,  pipeMedium, &infoFile); 
-  pipe5->SetLineColor(kGreen);
-  pipe->AddNode(pipe5, 0);
-  TGeoVolume* pipevac4 = MakeVacuum(4, nSects04, z04, rin04, rout04, vacuum,     &infoFile); 
-  pipevac4->SetLineColor(kCyan);
-  pipe->AddNode(pipevac4, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe6name << ", material: iron" << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe6 = MakePipe(6, nSects6,  z6,  rin6,  rout6, iron, &infoFile);
-  pipe6->SetLineColor(kBlue);
-  pipe->AddNode(pipe6, 0);
-  */
-
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-
-  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-  rootFile->Close();
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin, Double_t* rout, fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  return shape;
-}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TString volName  = Form("pipe%i", iPart);
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TString volName     = Form("pipevac%i", iPart);
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18b.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18b.C
deleted file mode 100644
index 33940aaf4e..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18b.C
+++ /dev/null
@@ -1,370 +0,0 @@
-/* Copyright (C) 2014-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Andrey Chernogorov, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v18b.C
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 04.06.2014
- **
- ** SIS-100
- ** pipe_v18a = pipe_v14f + fixed sizes of vacuum chamber for mvd_v14a
- **
- ** The beam pipe is composed of aluminium with a thickness proportional to the
- ** diameter (D(z)mm/60). It is placed directly into the cave as mother volume.
- ** The beam pipe consists of few sections excluding RICH section(1700-3700mm) 
- ** because it is part of the RICH geometry. Each section has a PCON shape 
- ** (including windows). There are two windows: first one @ 220mm with R600mm 
- ** and 0.7mm thickness, second one of iron @ 6000mm with R600mm and 0.2mm 
- ** thickness. The STS section is composed of cylinder D(z=220-500mm)=36mm and 
- ** cone (z=500-1700mm). All sections of the beam pipe with conical shape have 
- ** half opening angle 2.5deg. The PSD section of the beam pipe is missing 
- ** because it is planned that it will be part of PSD geometry.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "aluminium";  // "beryllium" "carbon"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macros name to info file
-TString macrosname = "create_bpipe_geometry_v18b.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v18b.root";
-// ---> Geometry name
-TString pipeName = "pipe_v18b";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v18b()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v18b:   **/
-  TString pipe1name         = "pipe1 - vacuum chamber";
-  const Int_t nSects1       = 6;
-  Double_t z1[nSects1]      = {-50., -5., -5., 150.17, 150.17, 150.87};  // mm
-  Double_t rin1[nSects1]    = {25., 25., 140., 140., 110., 110.};
-  Double_t rout1[nSects1]   = {25.7, 25.7, 140.7, 140.7, 140.7, 130.7};
-  TString pipe2name         = "pipe2 - first window @ 220mm, h=0.7mm, R=600mm";
-  const Int_t nSects2       = 7;
-  Double_t z2[nSects2]      = {140., 140.7, 141.45, 143.71, 147.49, 150.17, 150.87};  // mm
-  Double_t rin2[nSects2]    = {18., 18., 30., 60., 90., 105.86, 110.};
-  Double_t rout2[nSects2]   = {18., 28.69, 39.3, 65.55, 94.14, 110., 110.};
-  TString pipevac1name      = "pipevac1";
-  const Int_t nSects01      = 10;
-  Double_t z01[nSects01]    = {-50., -5., -5., 140., 140., 140.7, 141.45, 143.71, 147.49, 150.17};  // mm
-  Double_t rin01[nSects01]  = {0., 0., 0., 0., 18., 28.69, 39.3, 65.55, 94.14, 110.};
-  Double_t rout01[nSects01] = {25., 25., 140., 140., 140., 140., 140., 140., 140., 140.};
-
-  /*
-  TString pipe3name = "pipe3 - STS section";
-  const Int_t nSects3 = 4;
-  Double_t z3[nSects3]    = { 220.,  500.,  1250.,   1700.  }; // mm
-  Double_t rout3[nSects3] = {  18.,   18.,    55.,     74.2 };
-  Double_t rin3[nSects3]; for(Int_t i=0; i<nSects3; i++) { rin3[i] = rout3[i] - rout3[i]/30.; }
-  TString pipevac2name = "pipevac2";
-  const Int_t nSects02 = nSects3;
-  Double_t z02[nSects02]    = { 220.,  500.,  1250.,   1700. }; // mm
-  Double_t rin02[nSects02]  = {   0.,    0.,     0.,      0. };
-  Double_t rout02[nSects02]; for(Int_t i=0; i<nSects02; i++) { rout02[i]=rin3[i]; }
-
-//  TString pipe4name = "pipe4 - RICH section";
-//  const Int_t nSects4 = 2;
-//  Double_t z4[nSects4]    = { 1800.,   3700.  }; // mm
-//  Double_t rout4[nSects4] = {   74.2,   161.6 };
-//  Double_t rin4[nSects4]; for(Int_t i=0; i<nSects4; i++) { rin4[i] = rout4[i] - rout4[i]/30.; }
-//  TString pipevac3name = "pipevac3";
-//  const Int_t nSects03 = nSects4;
-//  Double_t z03[nSects03]    = { 1800.,   3700.   }; // mm
-//  Double_t rin03[nSects03]  = {    0.,      0.   };
-//  Double_t rout03[nSects03]; for(Int_t i=0; i<nSects03; i++) { rout03[i]=rin4[i]; }
-
-  TString pipe5name = "pipe5 - TRD & TOF section";
-  const Int_t nSects5 = 3;
-  Double_t z5[nSects5]    = { 3700.,   5999.8,  6000.   }; // mm
-  Double_t rout5[nSects5] = {  161.6,   261.96,  262.   };
-  Double_t rin5[nSects5]  = {  156.2,   253.23,  253.27 };
-  //Double_t rin5[nSects5]; for(Int_t i=0; i<nSects5; i++) { rin5[i] = rout5[i] - rout5[i]/30.; }
-  
-  TString pipevac4name = "pipevac4";
-  const Int_t nSects04 = 7;
-  Double_t z04[nSects04]    = { 3700.,   5943.24, 5943.44, 5947.34, 5959.8,  5981.19, 5999.8  }; // mm
-  Double_t rin04[nSects04]  = {    0.,      0.,      3.42,   70.,    140.,    210.,    253.23 };
-  //Double_t rout04[nSects04] = {  156.2,   250.87,  250.88,  251.05,  251.57,  252.48,  253.23 };
-  Double_t rout04[nSects04] = {  156.2,   250.84,  250.85,  251.01,  251.54,  252.44,  253.23 };
-  
-  TString pipe6name = "pipe6 - second window @ 6000mm, h=0.2mm, R=600mm"; // iron !!!
-  const Int_t nSects6 = 7;
-  Double_t z6[nSects6]     = { 5943.24, 5943.44, 5947.34, 5959.8,  5981.19, 5999.8,  6000.  }; // mm
-  Double_t rin6[nSects6]   = {    0.,      0.,     66.58,  138.88,  209.35,  252.28,  253.27 };
-  Double_t rout6[nSects6]  = {    0.,      3.42,   70.,    140.,    210.,    253.23,  253.27 };
-  */
-
-  // --------------------------------------------------------------------------
-
-  // -------------  Load the necessary FairRoot libraries   -------------------
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-100. Beam pipe geometry created with " + macrosname << endl << endl;
-  infoFile << "	  pipe_v18b = pipe_v14f + fixed sizes of vacuum chamber for "
-              "mvd_v14a"
-           << endl
-           << endl;
-  infoFile << " The beam pipe is composed of aluminium with a thickness "
-              "proportional to the"
-           << endl;
-  infoFile << " diameter (D(z)mm/60). It is placed directly into the cave as "
-              "mother volume."
-           << endl;
-  infoFile << " The beam pipe consists of few sections excluding RICH "
-              "section(1700-3700mm) "
-           << endl;
-  infoFile << " because it is part of the RICH geometry. Each section has a "
-              "PCON shape "
-           << endl;
-  infoFile << " (including windows). There are two windows: first one @ 220mm "
-              "with R600mm "
-           << endl;
-  infoFile << " and 0.7mm thickness, second one of iron @ 6000mm with R600mm "
-              "and 0.2mm "
-           << endl;
-  infoFile << " thickness. The STS section is composed of cylinder "
-              "D(z=220-500mm)=36mm and "
-           << endl;
-  infoFile << " cone (z=500-1700mm). All sections of the beam pipe with "
-              "conical shape have "
-           << endl;
-  infoFile << " half opening angle 2.5deg. The PSD section of the beam pipe is "
-              "missing "
-           << endl;
-  infoFile << " because it is planned that it will be part of PSD geometry." << endl << endl;
-
-  infoFile << "Material:  " << pipeMediumName << endl;
-  infoFile << "Thickness: D(z)mm/60" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-
-  TGeoVolume* pipe1 = MakePipe(1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
-  pipe1->SetLineColor(kGray);
-  pipe->AddNode(pipe1, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe2name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-  TGeoVolume* pipe2 = MakePipe(2, nSects2, z2, rin2, rout2, pipeMedium, &infoFile);
-  pipe2->SetLineColor(kBlue);
-  pipe->AddNode(pipe2, 0);
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  /*
-  infoFile << endl << "Beam pipe section: " << pipe3name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe3    = MakePipe  (3, nSects3,  z3,  rin3,  rout3,  pipeMedium, &infoFile); 
-  pipe3->SetLineColor(kGreen);
-  pipe->AddNode(pipe3, 0);
-  TGeoVolume* pipevac2 = MakeVacuum(2, nSects02, z02, rin02, rout02, vacuum,     &infoFile); 
-  pipevac2->SetLineColor(kCyan);
-  pipe->AddNode(pipevac2, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe4name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe4    = MakePipe  (4, nSects4,  z4,  rin4,  rout4,  pipeMedium, &infoFile); 
-  pipe4->SetLineColor(kGreen+2);
-  pipe->AddNode(pipe4, 0);
-  TGeoVolume* pipevac3 = MakeVacuum(3, nSects03, z03, rin03, rout03, vacuum,     &infoFile); 
-  pipevac3->SetLineColor(kCyan);
-  pipe->AddNode(pipevac3, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe5name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe5    = MakePipe  (5, nSects5,  z5,  rin5,  rout5,  pipeMedium, &infoFile); 
-  pipe5->SetLineColor(kGreen);
-  pipe->AddNode(pipe5, 0);
-  TGeoVolume* pipevac4 = MakeVacuum(4, nSects04, z04, rin04, rout04, vacuum,     &infoFile); 
-  pipevac4->SetLineColor(kCyan);
-  pipe->AddNode(pipevac4, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe6name << ", material: iron" << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe6 = MakePipe(6, nSects6,  z6,  rin6,  rout6, iron, &infoFile);
-  pipe6->SetLineColor(kBlue);
-  pipe->AddNode(pipe6, 0);
-  */
-
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-
-  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-  rootFile->Close();
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin, Double_t* rout, fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  return shape;
-}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TString volName  = Form("pipe%i", iPart);
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TString volName     = Form("pipevac%i", iPart);
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18c.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18c.C
deleted file mode 100644
index 845f4fabc8..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18c.C
+++ /dev/null
@@ -1,381 +0,0 @@
-/* Copyright (C) 2014-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Andrey Chernogorov, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v18c.C
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 04.06.2014
- **
- ** SIS-100
- ** pipe_v18a = pipe_v14f + fixed sizes of vacuum chamber for mvd_v14a
- **
- ** The beam pipe is composed of aluminium with a thickness proportional to the
- ** diameter (D(z)mm/60). It is placed directly into the cave as mother volume.
- ** The beam pipe consists of few sections excluding RICH section(1700-3700mm) 
- ** because it is part of the RICH geometry. Each section has a PCON shape 
- ** (including windows). There are two windows: first one @ 220mm with R600mm 
- ** and 0.7mm thickness, second one of iron @ 6000mm with R600mm and 0.2mm 
- ** thickness. The STS section is composed of cylinder D(z=220-500mm)=36mm and 
- ** cone (z=500-1700mm). All sections of the beam pipe with conical shape have 
- ** half opening angle 2.5deg. The PSD section of the beam pipe is missing 
- ** because it is planned that it will be part of PSD geometry.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "aluminium";  // "beryllium" "carbon"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macros name to info file
-TString macrosname = "create_bpipe_geometry_v18c.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v18c.root";
-// ---> Geometry name
-TString pipeName = "pipe_v18c";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v18c()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v18c:   **/
-  /*
-  TString pipe1name = "pipe1 - vacuum chamber";
-  const Int_t nSects1 = 6;
-  Double_t z1[nSects1]    = { -50.,  -5.,   -5.,  150.17, 150.17, 150.87 }; // mm
-  Double_t rin1[nSects1]  = {  25.,  25.,  140.,  140.,   110.,   110.   };
-  Double_t rout1[nSects1] = {  25.7, 25.7, 140.7, 140.7,  140.7,  130.7  };
-  TString pipe2name = "pipe2 - first window @ 220mm, h=0.7mm, R=600mm";
-  const Int_t nSects2 = 7;
-  Double_t z2[nSects2]    = { 140., 140.7, 141.45, 143.71, 147.49, 150.17, 150.87 }; // mm
-  Double_t rin2[nSects2]  = {  18.,  18.,   30.,    60.,    90.,   105.86, 110.   };
-  Double_t rout2[nSects2] = {  18.,  28.69, 39.3,   65.55,  94.14, 110.,   110.   };
-  */
-  TString pipevac1name      = "pipevac1";
-  const Int_t nSects01      = 2;
-  Double_t z01[nSects01]    = {0., 150.};  // mm
-  Double_t rin01[nSects01]  = {0., 0.};
-  Double_t rout01[nSects01] = {140., 140.};
-  //  const Int_t nSects01 = 10;
-  //  Double_t z01[nSects01]    = { -50., -5.,  -5., 140., 140., 140.7,  141.45, 143.71, 147.49, 150.17 }; // mm
-  //  Double_t rin01[nSects01]  = {   0.,  0.,   0.,   0.,  18.,  28.69,  39.3,   65.55,  94.14, 110.   };
-  //  Double_t rout01[nSects01] = {  25., 25., 140., 140., 140., 140.,   140.,   140.,   140.,   140.   };
-
-  /*
-  TString pipe3name = "pipe3 - STS section";
-  const Int_t nSects3 = 4;
-  Double_t z3[nSects3]    = { 220.,  500.,  1250.,   1700.  }; // mm
-  Double_t rout3[nSects3] = {  18.,   18.,    55.,     74.2 };
-  Double_t rin3[nSects3]; for(Int_t i=0; i<nSects3; i++) { rin3[i] = rout3[i] - rout3[i]/30.; }
-  TString pipevac2name = "pipevac2";
-  const Int_t nSects02 = nSects3;
-  Double_t z02[nSects02]    = { 220.,  500.,  1250.,   1700. }; // mm
-  Double_t rin02[nSects02]  = {   0.,    0.,     0.,      0. };
-  Double_t rout02[nSects02]; for(Int_t i=0; i<nSects02; i++) { rout02[i]=rin3[i]; }
-
-//  TString pipe4name = "pipe4 - RICH section";
-//  const Int_t nSects4 = 2;
-//  Double_t z4[nSects4]    = { 1800.,   3700.  }; // mm
-//  Double_t rout4[nSects4] = {   74.2,   161.6 };
-//  Double_t rin4[nSects4]; for(Int_t i=0; i<nSects4; i++) { rin4[i] = rout4[i] - rout4[i]/30.; }
-//  TString pipevac3name = "pipevac3";
-//  const Int_t nSects03 = nSects4;
-//  Double_t z03[nSects03]    = { 1800.,   3700.   }; // mm
-//  Double_t rin03[nSects03]  = {    0.,      0.   };
-//  Double_t rout03[nSects03]; for(Int_t i=0; i<nSects03; i++) { rout03[i]=rin4[i]; }
-
-  TString pipe5name = "pipe5 - TRD & TOF section";
-  const Int_t nSects5 = 3;
-  Double_t z5[nSects5]    = { 3700.,   5999.8,  6000.   }; // mm
-  Double_t rout5[nSects5] = {  161.6,   261.96,  262.   };
-  Double_t rin5[nSects5]  = {  156.2,   253.23,  253.27 };
-  //Double_t rin5[nSects5]; for(Int_t i=0; i<nSects5; i++) { rin5[i] = rout5[i] - rout5[i]/30.; }
-  
-  TString pipevac4name = "pipevac4";
-  const Int_t nSects04 = 7;
-  Double_t z04[nSects04]    = { 3700.,   5943.24, 5943.44, 5947.34, 5959.8,  5981.19, 5999.8  }; // mm
-  Double_t rin04[nSects04]  = {    0.,      0.,      3.42,   70.,    140.,    210.,    253.23 };
-  //Double_t rout04[nSects04] = {  156.2,   250.87,  250.88,  251.05,  251.57,  252.48,  253.23 };
-  Double_t rout04[nSects04] = {  156.2,   250.84,  250.85,  251.01,  251.54,  252.44,  253.23 };
-  
-  TString pipe6name = "pipe6 - second window @ 6000mm, h=0.2mm, R=600mm"; // iron !!!
-  const Int_t nSects6 = 7;
-  Double_t z6[nSects6]     = { 5943.24, 5943.44, 5947.34, 5959.8,  5981.19, 5999.8,  6000.  }; // mm
-  Double_t rin6[nSects6]   = {    0.,      0.,     66.58,  138.88,  209.35,  252.28,  253.27 };
-  Double_t rout6[nSects6]  = {    0.,      3.42,   70.,    140.,    210.,    253.23,  253.27 };
-  */
-
-  // --------------------------------------------------------------------------
-
-  // -------------  Load the necessary FairRoot libraries   -------------------
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-100. Beam pipe geometry created with " + macrosname << endl << endl;
-  infoFile << "	  pipe_v18c = pipe_v14f + fixed sizes of vacuum chamber for "
-              "mvd_v14a"
-           << endl
-           << endl;
-  infoFile << " The beam pipe is composed of aluminium with a thickness "
-              "proportional to the"
-           << endl;
-  infoFile << " diameter (D(z)mm/60). It is placed directly into the cave as "
-              "mother volume."
-           << endl;
-  infoFile << " The beam pipe consists of few sections excluding RICH "
-              "section(1700-3700mm) "
-           << endl;
-  infoFile << " because it is part of the RICH geometry. Each section has a "
-              "PCON shape "
-           << endl;
-  infoFile << " (including windows). There are two windows: first one @ 220mm "
-              "with R600mm "
-           << endl;
-  infoFile << " and 0.7mm thickness, second one of iron @ 6000mm with R600mm "
-              "and 0.2mm "
-           << endl;
-  infoFile << " thickness. The STS section is composed of cylinder "
-              "D(z=220-500mm)=36mm and "
-           << endl;
-  infoFile << " cone (z=500-1700mm). All sections of the beam pipe with "
-              "conical shape have "
-           << endl;
-  infoFile << " half opening angle 2.5deg. The PSD section of the beam pipe is "
-              "missing "
-           << endl;
-  infoFile << " because it is planned that it will be part of PSD geometry." << endl << endl;
-
-  infoFile << "Material:  " << pipeMediumName << endl;
-  infoFile << "Thickness: D(z)mm/60" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  infoFile << endl << "Beam pipe section: " << pipe2name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe2    = MakePipe  (2, nSects2,  z2,  rin2,  rout2,  pipeMedium, &infoFile);
-  //  pipe2->SetLineColor(kBlue);
-  //  pipe->AddNode(pipe2, 0);
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, air, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  /*
-  infoFile << endl << "Beam pipe section: " << pipe3name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe3    = MakePipe  (3, nSects3,  z3,  rin3,  rout3,  pipeMedium, &infoFile); 
-  pipe3->SetLineColor(kGreen);
-  pipe->AddNode(pipe3, 0);
-  TGeoVolume* pipevac2 = MakeVacuum(2, nSects02, z02, rin02, rout02, vacuum,     &infoFile); 
-  pipevac2->SetLineColor(kCyan);
-  pipe->AddNode(pipevac2, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe4name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe4    = MakePipe  (4, nSects4,  z4,  rin4,  rout4,  pipeMedium, &infoFile); 
-  pipe4->SetLineColor(kGreen+2);
-  pipe->AddNode(pipe4, 0);
-  TGeoVolume* pipevac3 = MakeVacuum(3, nSects03, z03, rin03, rout03, vacuum,     &infoFile); 
-  pipevac3->SetLineColor(kCyan);
-  pipe->AddNode(pipevac3, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe5name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe5    = MakePipe  (5, nSects5,  z5,  rin5,  rout5,  pipeMedium, &infoFile); 
-  pipe5->SetLineColor(kGreen);
-  pipe->AddNode(pipe5, 0);
-  TGeoVolume* pipevac4 = MakeVacuum(4, nSects04, z04, rin04, rout04, vacuum,     &infoFile); 
-  pipevac4->SetLineColor(kCyan);
-  pipe->AddNode(pipevac4, 0);
-
-  infoFile << endl << "Beam pipe section: " << pipe6name << ", material: iron" << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  TGeoVolume* pipe6 = MakePipe(6, nSects6,  z6,  rin6,  rout6, iron, &infoFile);
-  pipe6->SetLineColor(kBlue);
-  pipe->AddNode(pipe6, 0);
-  */
-
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-
-  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-  rootFile->Close();
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin, Double_t* rout, fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  return shape;
-}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TString volName  = Form("pipe%i", iPart);
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TGeoPcon* shape = new TGeoPcon(0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TString volName     = Form("pipevac%i", iPart);
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18d.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18d.C
deleted file mode 100644
index dcead7047e..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18d.C
+++ /dev/null
@@ -1,304 +0,0 @@
-/* Copyright (C) 2016-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v16c_1e.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";
-//TString pipeMediumName = "carbon"; // "beryllium" "aluminium"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v18d.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v18d_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v18d";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v18d()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v18d:   **/
-  TString pipe1name       = "pipe1 - straight miniCBM beampipe";
-  const Int_t nSects1     = 2;
-  Double_t z1[nSects1]    = {0., 3000.};  // mm
-  Double_t rin1[nSects1]  = {50., 50.};
-  Double_t rout1[nSects1] = {48., 48.};
-
-  const Int_t nSects01      = 2;
-  Double_t z01[nSects01]    = {0., 3000.};  // mm
-  Double_t rin01[nSects01]  = {0., 0.};
-  Double_t rout01[nSects01] = {48., 48.};
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  //  const Double_t pipewallthickness = 2.0; // mm
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-100. Beam pipe geometry created with " + macroname << endl << endl;
-  infoFile << "  pipe v18d - is a pipe for the STS up to the interface to RICH "
-              "at z = 1700 mm"
-           << endl
-           << endl;
-  infoFile << "                 with a (blue) flange at the downstream end of "
-              "the STS box"
-           << endl
-           << endl;
-  infoFile << "The beam pipe is composed of carbon with a fixed wall thickness "
-              "of 0.5 or 1.0 mm."
-           << endl;
-  infoFile << "It is placed directly into the cave as mother volume. The beam "
-              "pipe consists of"
-           << endl;
-  infoFile << "few sections up to the RICH section (1700-3700mm), which is "
-              "part of the RICH geometry."
-           << endl;
-  infoFile << "Each section has a PCON shape (including windows)." << endl;
-  infoFile << "The STS section is composed of cylinder D(z=220-410mm)=34mm and "
-              "cone (z=410-1183mm)."
-           << endl;
-  infoFile << "All sections of the beam pipe with conical shape have half "
-              "opening angle 2.5deg."
-           << endl
-           << endl;
-
-  infoFile << "Material:  " << pipeMediumName << endl;
-  //  infoFile << "Wall Thickness: " << pipewallthickness << " mm" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-  TGeoVolume* pipe1 = MakePipe(1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
-  pipe1->SetLineColor(kYellow);
-  //  pipe1->SetLineColor(kGray);
-  pipe->AddNode(pipe1, 0);
-
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipe%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipevac%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18e.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18e.C
deleted file mode 100644
index 66eca58343..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18e.C
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Copyright (C) 2016-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v16c_1e.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";
-//TString pipeMediumName = "carbon"; // "beryllium" "aluminium"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v18e.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v18e_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v18e";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v18e()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v18e:   **/
-  TString pipe1name       = "pipe1 - straight miniCBM beampipe";
-  const Int_t nSects1     = 2;
-  Double_t z1[nSects1]    = {0., 3000.};  // mm
-  Double_t rin1[nSects1]  = {50., 50.};
-  Double_t rout1[nSects1] = {48., 48.};
-
-  const Int_t nSects01      = 2;
-  Double_t z01[nSects01]    = {0., 3000.};  // mm
-  Double_t rin01[nSects01]  = {0., 0.};
-  Double_t rout01[nSects01] = {48., 48.};
-
-  //  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-  Double_t pipe_angle = 20.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  //  const Double_t pipewallthickness = 2.0; // mm
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-100. Beam pipe geometry created with " + macroname << endl << endl;
-  infoFile << "  pipe v18e - is a pipe for the STS up to the interface to RICH "
-              "at z = 1700 mm"
-           << endl
-           << endl;
-  infoFile << "                 with a (blue) flange at the downstream end of "
-              "the STS box"
-           << endl
-           << endl;
-  infoFile << "The beam pipe is composed of carbon with a fixed wall thickness "
-              "of 0.5 or 1.0 mm."
-           << endl;
-  infoFile << "It is placed directly into the cave as mother volume. The beam "
-              "pipe consists of"
-           << endl;
-  infoFile << "few sections up to the RICH section (1700-3700mm), which is "
-              "part of the RICH geometry."
-           << endl;
-  infoFile << "Each section has a PCON shape (including windows)." << endl;
-  infoFile << "The STS section is composed of cylinder D(z=220-410mm)=34mm and "
-              "cone (z=410-1183mm)."
-           << endl;
-  infoFile << "All sections of the beam pipe with conical shape have half "
-              "opening angle 2.5deg."
-           << endl
-           << endl;
-
-  infoFile << "Material:  " << pipeMediumName << endl;
-  //  infoFile << "Wall Thickness: " << pipewallthickness << " mm" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-  TGeoVolume* pipe1 = MakePipe(1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
-  pipe1->SetLineColor(kYellow);
-  //  pipe1->SetLineColor(kGray);
-  pipe->AddNode(pipe1, 0);
-
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipe%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipevac%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18f.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18f.C
deleted file mode 100644
index cb7fa03227..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18f.C
+++ /dev/null
@@ -1,308 +0,0 @@
-/* Copyright (C) 2016-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v16c_1e.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";
-//TString pipeMediumName = "carbon"; // "beryllium" "aluminium"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v18f.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v18f_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v18f";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v18f()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v18f:   **/
-  TString pipe1name       = "pipe1 - straight miniCBM beampipe";
-  const Int_t nSects1     = 4;
-  Double_t z1[nSects1]    = {0., 480., 520., 4000.};  // mm 3000. };
-  Double_t rin1[nSects1]  = {30., 30., 50., 50.};
-  Double_t rout1[nSects1] = {28., 28., 48., 48.};
-
-  const Int_t nSects01      = 4;
-  Double_t z01[nSects01]    = {0., 480., 520., 4000.};  // mm 3000. };
-  Double_t rin01[nSects01]  = {0., 0., 0., 0.};
-  Double_t rout01[nSects01] = {28., 28., 48., 48.};
-
-  //  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-  Double_t pipe_angle = 20.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  //  const Double_t pipewallthickness = 2.0; // mm
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-100. Beam pipe geometry created with " + macroname << endl << endl;
-  infoFile << "  pipe v18f - is a pipe for the STS up to the interface to RICH "
-              "at z = 1700 mm"
-           << endl
-           << endl;
-  infoFile << "                 with a (blue) flange at the downstream end of "
-              "the STS box"
-           << endl
-           << endl;
-  infoFile << "The beam pipe is composed of carbon with a fixed wall thickness "
-              "of 0.5 or 1.0 mm."
-           << endl;
-  infoFile << "It is placed directly into the cave as mother volume. The beam "
-              "pipe consists of"
-           << endl;
-  infoFile << "few sections up to the RICH section (1700-3700mm), which is "
-              "part of the RICH geometry."
-           << endl;
-  infoFile << "Each section has a PCON shape (including windows)." << endl;
-  infoFile << "The STS section is composed of cylinder D(z=220-410mm)=34mm and "
-              "cone (z=410-1183mm)."
-           << endl;
-  infoFile << "All sections of the beam pipe with conical shape have half "
-              "opening angle 2.5deg."
-           << endl
-           << endl;
-
-  infoFile << "Material:  " << pipeMediumName << endl;
-  //  infoFile << "Wall Thickness: " << pipewallthickness << " mm" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-  TGeoVolume* pipe1 = MakePipe(1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
-  pipe1->SetLineColor(kYellow);
-  //  pipe1->SetLineColor(kGray);
-  pipe->AddNode(pipe1, 0);
-
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipe%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipevac%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18g.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18g.C
deleted file mode 100644
index ffad9fc81d..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v18g.C
+++ /dev/null
@@ -1,309 +0,0 @@
-/* Copyright (C) 2016-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v16c_1e.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";
-//TString pipeMediumName = "carbon"; // "beryllium" "aluminium"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v18g.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v18g_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v18g";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v18g()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v18g:   **/
-  TString pipe1name       = "pipe1 - straight miniCBM beampipe";
-  const Int_t nSects1     = 4;
-  Double_t z1[nSects1]    = {0., 480., 520., 4000.};  // mm 3000. };
-  Double_t rin1[nSects1]  = {28., 28., 48., 48.};
-  Double_t rout1[nSects1] = {30., 30., 50., 50.};
-
-  const Int_t nSects01      = 4;
-  Double_t z01[nSects01]    = {0., 480., 520., 4000.};  // mm 3000. };
-  Double_t rin01[nSects01]  = {0., 0., 0., 0.};
-  Double_t rout01[nSects01] = {28., 28., 48., 48.};
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-  //  Double_t pipe_angle = 20.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  //  const Double_t pipewallthickness = 2.0; // mm
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-100. Beam pipe geometry created with " + macroname << endl << endl;
-  infoFile << "  pipe v18g - is a pipe for the STS up to the interface to RICH "
-              "at z = 1700 mm"
-           << endl
-           << endl;
-  infoFile << "                 with a (blue) flange at the downstream end of "
-              "the STS box"
-           << endl
-           << endl;
-  infoFile << "The beam pipe is composed of carbon with a fixed wall thickness "
-              "of 0.5 or 1.0 mm."
-           << endl;
-  infoFile << "It is placed directly into the cave as mother volume. The beam "
-              "pipe consists of"
-           << endl;
-  infoFile << "few sections up to the RICH section (1700-3700mm), which is "
-              "part of the RICH geometry."
-           << endl;
-  infoFile << "Each section has a PCON shape (including windows)." << endl;
-  infoFile << "The STS section is composed of cylinder D(z=220-410mm)=34mm and "
-              "cone (z=410-1183mm)."
-           << endl;
-  infoFile << "All sections of the beam pipe with conical shape have half "
-              "opening angle 2.5deg."
-           << endl
-           << endl;
-
-  infoFile << "Material:  " << pipeMediumName << endl;
-  //  infoFile << "Wall Thickness: " << pipewallthickness << " mm" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-  TGeoVolume* pipe1 = MakePipe(1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
-  pipe1->SetLineColor(kYellow);
-  //  pipe1->SetLineColor(kGray);
-  pipe->AddNode(pipe1, 0);
-
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipe%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipevac%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v19a.C b/macro/mcbm/geometry/pipe/create_bpipe_geometry_v19a.C
deleted file mode 100644
index 7024d734d8..0000000000
--- a/macro/mcbm/geometry/pipe/create_bpipe_geometry_v19a.C
+++ /dev/null
@@ -1,291 +0,0 @@
-/* Copyright (C) 2016-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19a.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";
-//TString pipeMediumName = "carbon"; // "beryllium" "aluminium"
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19a.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v19a_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v19a";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile);
-
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19a()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19a:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // pipe1
-  const Int_t nSects1     = 4;
-  Double_t z1[nSects1]    = {0., 590., 630., 4000.};  // mm 3000. };
-  Double_t rin1[nSects1]  = {25., 25., 48., 48.};
-  Double_t rout1[nSects1] = {27., 27., 50., 50.};
-
-  // pipevac1
-  const Int_t nSects01      = 4;
-  Double_t z01[nSects01]    = {0., 590., 630., 4000.};  // mm 3000. };
-  Double_t rin01[nSects01]  = {0., 0., 0., 0.};
-  Double_t rout01[nSects01] = {25., 25., 48., 48.};
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "a small diameter section attached to the target chamber." << endl << endl;
-  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a fixed wall thickness "
-              "of 2.0 mm."
-           << endl
-           << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10)
-           << "h,mm" << endl;
-  TGeoVolume* pipe1 = MakePipe(1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
-  pipe1->SetLineColor(kYellow);
-  //  pipe1->SetLineColor(kGray);
-  pipe->AddNode(pipe1, 0);
-
-  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
-  pipevac1->SetLineColor(kCyan);
-  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                     fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipe%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-    *infoFile << setw(2) << iSect + 1 << setw(10) << fixed << setprecision(2) << z[iSect] << setw(10) << fixed
-              << setprecision(2) << rin[iSect] << setw(10) << fixed << setprecision(2) << rout[iSect] << setw(10)
-              << fixed << setprecision(2) << rout[iSect] - rin[iSect] << endl;
-  }
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// =====   Make the volume for the vacuum inside the beam pipe   ==============
-TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin, Double_t* rout, TGeoMedium* medium,
-                       fstream* infoFile)
-{
-
-  // ---> Shape
-  TString volName = Form("pipevac%i", iPart);
-  TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-    shape->DefineSection(iSect, z[iSect] / 10., rin[iSect] / 10., rout[iSect] / 10.);  // mm->cm
-  }
-
-  // ---> Volume
-  TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipevac;
-}
-// ============================================================================
diff --git a/macro/mcbm/geometry/platform/create_platform_v18a.C b/macro/mcbm/geometry/platform/create_platform_v18a.C
deleted file mode 100644
index 74389a93db..0000000000
--- a/macro/mcbm/geometry/platform/create_platform_v18a.C
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Copyright (C) 2013-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_pipegeo_v16.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 11.10.2013
- **
- ** The beam pipe is composed of carbon with a thickness of 0.5 mm. It is
- ** placed directly into the cave as mother volume.
- ** The pipe consists of a number of parts. Each part has a PCON
- ** shape. The beam pipe inside the RICH is part of the RICH geometry;
- ** the beam pipe geometry thus excludes the z range of the RICH in case
- ** the latter is present in the setup.
-  *****************************************************************************/
-
-
-#include "TGeoManager.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-// -------------   Other global variables   -----------------------------------
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_platform_v18a()
-{
-
-  // -----   Define platform parts   ----------------------------------------------
-
-  /** For v18a (mCBM)   **/
-  TString geoTag = "v18a_mcbm";
-
-  //  Double_t platform_angle = 25.;  // rotation angle around y-axis
-  Double_t platform_angle = 19.;    // rotation angle around y-axis
-  Double_t platX_offset   = -230.;  // offset to the right side along x-axis
-
-  Double_t sizeX = 80.0;   // symmetric in x
-  Double_t sizeY = 200.0;  // without rails
-  Double_t sizeZ = 500.0;  // short version
-
-  //  Double_t endZ  = 450.0;  // ends at z = 450.0
-
-  //  /** For v16b (SIS 300)   **/
-  //  TString geoTag = "v16b";
-  //  Double_t sizeX = 725.0;  // symmetric in x
-  //  Double_t sizeY = 234.0;  // without rails
-  //  Double_t sizeZ = 455.0;  // long version
-  //  Double_t endZ  = 540.0;  // ends at z = 450.0
-
-  //  Double_t beamY = 570.0;  // nominal beam height
-  Double_t beamY = 100.0;  // nominal beam height
-  Double_t posX  = -sizeX / 2.;
-  Double_t posY  = -beamY + sizeY / 2.;  // rest on the floor at -beamY
-  Double_t posZ  = +sizeZ / 2.;
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "platform_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "Platform geometry created with create_platform_v16.C" << std::endl << std::endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> aluminium
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (!mAluminium) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  if (!aluminium) Fatal("Main", "Medium aluminium not found");
-
-  //  // ---> air
-  //  FairGeoMedium* mAir  = geoMedia->getMedium("air");
-  //  if ( ! mAir ) Fatal("Main", "FairMedium air not found");
-  //  geoBuild->createMedium(mAir);
-  //  TGeoMedium* air = gGeoMan->GetMedium("air");
-  //  if ( ! air ) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PLATFORMgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-  TString platformName = "platform_";
-  platformName += geoTag;
-  TGeoVolume* platform = new TGeoVolumeAssembly(platformName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create   ---------------------------------------------------------
-  TGeoBBox* platform_base  = new TGeoBBox("", sizeX / 2., sizeY / 2., sizeZ / 2.);
-  TGeoVolume* platform_vol = new TGeoVolume("platform", platform_base, aluminium);
-  platform_vol->SetLineColor(kBlue);
-  platform_vol->SetTransparency(70);
-
-  TGeoTranslation* platform_trans = new TGeoTranslation("", posX, posY, posZ);
-  platform->AddNode(platform_vol, 1, platform_trans);
-
-  infoFile << "sizeX: " << setprecision(2) << sizeX << "sizeY: " << setprecision(2) << sizeY
-           << "sizeZ: " << setprecision(2) << sizeZ << endl;
-  infoFile << "posX : " << setprecision(2) << posX << "posY : " << setprecision(2) << posY
-           << "posZ : " << setprecision(2) << posZ << endl;
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(platform, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  platform->Export(geoFileName);  // an alternative way of writing the platform volume
-
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-
-  // rotate the platform around y
-  TGeoRotation* platform_rotation = new TGeoRotation();
-  platform_rotation->RotateY(platform_angle);
-  //  TGeoCombiTrans* platform_placement = new TGeoCombiTrans( sin( platform_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., platform_rotation);
-  TGeoCombiTrans* platform_placement = new TGeoCombiTrans("platform_rot", platX_offset, 0., 0, platform_rotation);
-
-
-  //  TGeoTranslation* platform_placement = new TGeoTranslation("platform_trans", 0., 0., 0.);
-  platform_placement->Write();
-  geoFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
diff --git a/macro/mcbm/geometry/platform/create_platform_v18c.C b/macro/mcbm/geometry/platform/create_platform_v18c.C
deleted file mode 100644
index 95b3b1a4ac..0000000000
--- a/macro/mcbm/geometry/platform/create_platform_v18c.C
+++ /dev/null
@@ -1,178 +0,0 @@
-/* Copyright (C) 2013-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_pipegeo_v16.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 11.10.2013
- **
- ** The beam pipe is composed of carbon with a thickness of 0.5 mm. It is
- ** placed directly into the cave as mother volume.
- ** The pipe consists of a number of parts. Each part has a PCON
- ** shape. The beam pipe inside the RICH is part of the RICH geometry;
- ** the beam pipe geometry thus excludes the z range of the RICH in case
- ** the latter is present in the setup.
-  *****************************************************************************/
-
-
-#include "TGeoManager.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-// -------------   Other global variables   -----------------------------------
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_platform_v18c()
-{
-
-  // -----   Define platform parts   ----------------------------------------------
-
-  /** For v18c (mCBM)   **/
-  TString geoTag = "v18c_mcbm";
-
-  //  Double_t platform_angle = 25.;  // rotation angle around y-axis
-  //  Double_t platform_angle =   19.;  // rotation angle around y-axis
-  Double_t platform_angle = 0.;  // rotation angle around y-axis
-  //  Double_t platX_offset   = -230.;  // offset to the right side along x-axis
-  Double_t platX_offset = 0.;  // offset to the right side along x-axis
-
-  Double_t sizeX = 80.0;   // table width
-  Double_t sizeY = 80.0;   // table height
-  Double_t sizeZ = 400.0;  // table length
-
-  //  Double_t endZ  = 450.0;  // ends at z = 450.0
-
-  //  /** For v16b (SIS 300)   **/
-  //  TString geoTag = "v16b";
-  //  Double_t sizeX = 725.0;  // symmetric in x
-  //  Double_t sizeY = 234.0;  // without rails
-  //  Double_t sizeZ = 455.0;  // long version
-  //  Double_t endZ  = 540.0;  // ends at z = 450.0
-
-  //  Double_t beamY = 570.0;  // nominal beam height
-  Double_t beamY = 200.0;  // nominal beam height
-  Double_t posX  = 0;
-  Double_t posY  = -beamY + sizeY / 2.;  // rest on the floor at -beamY
-  Double_t posZ  = +sizeZ / 2.;
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "platform_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "Platform geometry created with create_platform_v16.C" << std::endl << std::endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //  // ---> aluminium
-  //  FairGeoMedium* mAluminium      = geoMedia->getMedium("aluminium");
-  //  if ( ! mAluminium ) Fatal("Main", "FairMedium aluminium not found");
-  //  geoBuild->createMedium(mAluminium);
-  //  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  //  if ( ! aluminium ) Fatal("Main", "Medium aluminium not found");
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PLATFORMgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-  TString platformName = "platform_";
-  platformName += geoTag;
-  TGeoVolume* platform = new TGeoVolumeAssembly(platformName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create   ---------------------------------------------------------
-  TGeoBBox* platform_base  = new TGeoBBox("", sizeX / 2., sizeY / 2., sizeZ / 2.);
-  TGeoVolume* platform_vol = new TGeoVolume("platform", platform_base, air);
-  platform_vol->SetLineColor(kBlue);
-  platform_vol->SetTransparency(70);
-
-  TGeoTranslation* platform_trans = new TGeoTranslation("", posX, posY, posZ);
-  platform->AddNode(platform_vol, 1, platform_trans);
-
-  infoFile << "sizeX: " << setprecision(2) << sizeX << "sizeY: " << setprecision(2) << sizeY
-           << "sizeZ: " << setprecision(2) << sizeZ << endl;
-  infoFile << "posX : " << setprecision(2) << posX << "posY : " << setprecision(2) << posY
-           << "posZ : " << setprecision(2) << posZ << endl;
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(platform, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  platform->Export(geoFileName);  // an alternative way of writing the platform volume
-
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-
-  // rotate the platform around y
-  TGeoRotation* platform_rotation = new TGeoRotation();
-  platform_rotation->RotateY(platform_angle);
-  //  TGeoCombiTrans* platform_placement = new TGeoCombiTrans( sin( platform_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., platform_rotation);
-  TGeoCombiTrans* platform_placement = new TGeoCombiTrans("platform_rot", platX_offset, 0., 0, platform_rotation);
-
-
-  //  TGeoTranslation* platform_placement = new TGeoTranslation("platform_trans", 0., 0., 0.);
-  platform_placement->Write();
-  geoFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
diff --git a/macro/mcbm/geometry/platform/create_platform_v18d.C b/macro/mcbm/geometry/platform/create_platform_v18d.C
deleted file mode 100644
index 47df6a1794..0000000000
--- a/macro/mcbm/geometry/platform/create_platform_v18d.C
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Copyright (C) 2013-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_pipegeo_v16.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 11.10.2013
- **
- ** The beam pipe is composed of carbon with a thickness of 0.5 mm. It is
- ** placed directly into the cave as mother volume.
- ** The pipe consists of a number of parts. Each part has a PCON
- ** shape. The beam pipe inside the RICH is part of the RICH geometry;
- ** the beam pipe geometry thus excludes the z range of the RICH in case
- ** the latter is present in the setup.
-  *****************************************************************************/
-
-// 2018.08.23 - DE - shorten the table length from 400 cm to 250 cm
-
-
-#include "TGeoManager.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-// -------------   Other global variables   -----------------------------------
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_platform_v18d()
-{
-
-  // -----   Define platform parts   ----------------------------------------------
-
-  /** For v18d (mCBM)   **/
-  TString geoTag = "v18d_mcbm";
-
-  //  Double_t platform_angle = 25.;  // rotation angle around y-axis
-  //  Double_t platform_angle =   19.;  // rotation angle around y-axis
-  Double_t platform_angle = 0.;  // rotation angle around y-axis
-  //  Double_t platX_offset   = -230.;  // offset to the right side along x-axis
-  Double_t platX_offset = 0.;  // offset to the right side along x-axis
-
-  Double_t sizeX = 80.0;   // table width
-  Double_t sizeY = 80.0;   // table height
-  Double_t sizeZ = 250.0;  // table length
-
-  //  Double_t endZ  = 450.0;  // ends at z = 450.0
-
-  //  /** For v16b (SIS 300)   **/
-  //  TString geoTag = "v16b";
-  //  Double_t sizeX = 725.0;  // symmetric in x
-  //  Double_t sizeY = 234.0;  // without rails
-  //  Double_t sizeZ = 455.0;  // long version
-  //  Double_t endZ  = 540.0;  // ends at z = 450.0
-
-  //  Double_t beamY = 570.0;  // nominal beam height
-  Double_t beamY = 200.0;  // nominal beam height
-  Double_t posX  = 0;
-  Double_t posY  = -beamY + sizeY / 2.;  // rest on the floor at -beamY
-  Double_t posZ  = +sizeZ / 2.;
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "platform_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "Platform geometry created with create_platform_v16.C" << std::endl << std::endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //  // ---> aluminium
-  //  FairGeoMedium* mAluminium      = geoMedia->getMedium("aluminium");
-  //  if ( ! mAluminium ) Fatal("Main", "FairMedium aluminium not found");
-  //  geoBuild->createMedium(mAluminium);
-  //  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  //  if ( ! aluminium ) Fatal("Main", "Medium aluminium not found");
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PLATFORMgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-  TString platformName = "platform_";
-  platformName += geoTag;
-  TGeoVolume* platform = new TGeoVolumeAssembly(platformName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create   ---------------------------------------------------------
-  TGeoBBox* platform_base  = new TGeoBBox("", sizeX / 2., sizeY / 2., sizeZ / 2.);
-  TGeoVolume* platform_vol = new TGeoVolume("platform", platform_base, air);
-  platform_vol->SetLineColor(kBlue);
-  platform_vol->SetTransparency(70);
-
-  TGeoTranslation* platform_trans = new TGeoTranslation("", posX, posY, posZ);
-  platform->AddNode(platform_vol, 1, platform_trans);
-
-  infoFile << "sizeX: " << setprecision(2) << sizeX << "sizeY: " << setprecision(2) << sizeY
-           << "sizeZ: " << setprecision(2) << sizeZ << endl;
-  infoFile << "posX : " << setprecision(2) << posX << "posY : " << setprecision(2) << posY
-           << "posZ : " << setprecision(2) << posZ << endl;
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(platform, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  platform->Export(geoFileName);  // an alternative way of writing the platform volume
-
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-
-  // rotate the platform around y
-  TGeoRotation* platform_rotation = new TGeoRotation();
-  platform_rotation->RotateY(platform_angle);
-  //  TGeoCombiTrans* platform_placement = new TGeoCombiTrans( sin( platform_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., platform_rotation);
-  TGeoCombiTrans* platform_placement = new TGeoCombiTrans("platform_rot", platX_offset, 0., 0, platform_rotation);
-
-
-  //  TGeoTranslation* platform_placement = new TGeoTranslation("platform_trans", 0., 0., 0.);
-  platform_placement->Write();
-  geoFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
diff --git a/macro/mcbm/geometry/platform/create_platform_v20a.C b/macro/mcbm/geometry/platform/create_platform_v20a.C
deleted file mode 100644
index 2f8b02ca66..0000000000
--- a/macro/mcbm/geometry/platform/create_platform_v20a.C
+++ /dev/null
@@ -1,193 +0,0 @@
-/* Copyright (C) 2013-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_pipegeo_v16.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 11.10.2013
- **
- ** The beam pipe is composed of carbon with a thickness of 0.5 mm. It is
- ** placed directly into the cave as mother volume.
- ** The pipe consists of a number of parts. Each part has a PCON
- ** shape. The beam pipe inside the RICH is part of the RICH geometry;
- ** the beam pipe geometry thus excludes the z range of the RICH in case
- ** the latter is present in the setup.
-  *****************************************************************************/
-
-// 2020.05.05 - DE - update table dimensions and position measured by Christian Sturm
-// 2018.08.23 - DE - shorten the table length from 400 cm to 250 cm
-
-#include "TGeoManager.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-using namespace std;
-
-// -------------   Other global variables   -----------------------------------
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_platform_v20a()
-{
-
-  // -----   Define platform parts   ----------------------------------------------
-
-  /** For v20a (mCBM)   **/
-  TString geoTag = "v20a_mcbm";
-
-  //  Double_t platform_angle = 25.;  // rotation angle around y-axis
-  //  Double_t platform_angle =   19.;  // rotation angle around y-axis
-  Double_t platform_angle = 0.;  // rotation angle around y-axis
-  //  Double_t platX_offset   = -230.;  // offset to the right side along x-axis
-
-  Double_t platX_offset = -25.1;  // offset along x-axis
-  Double_t platY_offset = 0.0;    // offset along y-axis
-  Double_t platZ_offset = 13.7;   // offset along z-axis
-
-  Double_t sizeX = 100.0;  // table width   // until 15.05.2020:  80.0;
-  Double_t sizeY = 98.5;   // table height  // until 15.05.2020:  80.0;
-  Double_t sizeZ = 215.5;  // table length  // until 15.05.2020: 250.0;
-
-  //  Double_t endZ  = 450.0;  // ends at z = 450.0
-
-  //  /** For v16b (SIS 300)   **/
-  //  TString geoTag = "v16b";
-  //  Double_t sizeX = 725.0;  // symmetric in x
-  //  Double_t sizeY = 234.0;  // without rails
-  //  Double_t sizeZ = 455.0;  // long version
-  //  Double_t endZ  = 540.0;  // ends at z = 450.0
-
-  //  Double_t beamY = 570.0;  // nominal beam height
-  Double_t beamY = 200.0;  // nominal beam height
-  Double_t posX  = 0;
-  Double_t posY  = -beamY + sizeY / 2.;  // rest on the floor at -beamY
-  Double_t posZ  = +sizeZ / 2.;
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "platform_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "Platform geometry created with create_platform_v20a.C" << std::endl << std::endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //  // ---> aluminium
-  //  FairGeoMedium* mAluminium      = geoMedia->getMedium("aluminium");
-  //  if ( ! mAluminium ) Fatal("Main", "FairMedium aluminium not found");
-  //  geoBuild->createMedium(mAluminium);
-  //  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  //  if ( ! aluminium ) Fatal("Main", "Medium aluminium not found");
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PLATFORMgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-  TString platformName = "platform_";
-  platformName += geoTag;
-  TGeoVolume* platform = new TGeoVolumeAssembly(platformName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create   ---------------------------------------------------------
-  TGeoBBox* platform_base  = new TGeoBBox("", sizeX / 2., sizeY / 2., sizeZ / 2.);
-  TGeoVolume* platform_vol = new TGeoVolume("platform", platform_base, air);
-  platform_vol->SetLineColor(kBlue);
-  platform_vol->SetTransparency(70);
-
-  TGeoTranslation* platform_trans = new TGeoTranslation("", posX, posY, posZ);
-  platform->AddNode(platform_vol, 1, platform_trans);
-
-  infoFile << "sizeX   : " << setprecision(2) << sizeX << " cm " << endl
-           << "sizeY   : " << setprecision(2) << sizeY << " cm " << endl
-           << "sizeZ   : " << setprecision(2) << sizeZ << " cm " << endl
-           << endl;
-
-  infoFile << "posX    : " << setprecision(2) << posX << " cm " << endl
-           << "posY    : " << setprecision(2) << posY << " cm " << endl
-           << "posZ    : " << setprecision(2) << posZ << " cm " << endl
-           << endl;
-
-  infoFile << "offsetX : " << setprecision(2) << platX_offset << " cm " << endl
-           << "offsetY : " << setprecision(2) << platY_offset << " cm " << endl
-           << "offsetZ : " << setprecision(2) << platZ_offset << " cm " << endl
-           << endl;
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(platform, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  platform->Export(geoFileName);  // an alternative way of writing the platform volume
-
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-
-  // rotate the platform around y
-  TGeoRotation* platform_rotation = new TGeoRotation();
-  platform_rotation->RotateY(platform_angle);
-  //  TGeoCombiTrans* platform_placement = new TGeoCombiTrans( sin( platform_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., platform_rotation);
-  TGeoCombiTrans* platform_placement =
-    new TGeoCombiTrans("platform_rot", platX_offset, platY_offset, platZ_offset, platform_rotation);
-
-  //  TGeoTranslation* platform_placement = new TGeoTranslation("platform_trans", 0., 0., 0.);
-  platform_placement->Write();
-  geoFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
diff --git a/macro/mcbm/geometry/psd/create_psdgeo_v18a.C b/macro/mcbm/geometry/psd/create_psdgeo_v18a.C
deleted file mode 100644
index f075657467..0000000000
--- a/macro/mcbm/geometry/psd/create_psdgeo_v18a.C
+++ /dev/null
@@ -1,469 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/** @file create_psdgeo_v18a.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 16 September 2017
- ** @version 1.0
- **
- ** This macro creates a PSD geometry in ROOT format to be used as input
- ** for the transport simulation. It allows to create module stacks of
- ** varying sizes; the numbers of rows and columns must both be uneven.
- ** The centre module as well as the edge modules are omitted.
- ** The module definition is implemented in the function ConstructModule.
- **
- ** The user can adjust the steering variables to the specific needs.
- **
- ** 2017-12-02 - DE - adapted mPSD v18a, single module to mCBM setup
- **
- **/
-
-
-using std::cout;
-using std::endl;
-using std::fstream;
-using std::right;
-using std::setw;
-
-// Forward declarations
-TGeoVolume* ConstructModule(const char* name, Double_t moduleSize, Int_t nLayers, fstream* info = 0);
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_psdgeo_v18a()
-{
-
-  // -----   Steering variables   ---------------------------------------------
-  const char* geoTag = "v18a_mcbm";  // geometry tag
-
-  Double_t psdX       = 0.;     // x position is automatically determined from psdRotY
-  Double_t psdY       = -155.;  // y position of PSD in cave
-  Double_t psdZ       = 160.;   // z position of PSD in cave (back side)
-  Double_t psdRotX    = 0.;     // Rotation of PSD around x axis [degrees]
-  Double_t psdRotY    = 20.;    // Rotation of PSD around y axis [degrees]
-  Double_t moduleSize = 20.;    // Module size [cm]
-  Int_t nModulesX     = 1;      // Number of modules in a row (x direction)
-  Int_t nModulesY     = 1;      // Number of modules in a row (x direction)
-  // --------------------------------------------------------------------------
-
-
-  // ---- Number of modules per row/column must be uneven ---------------------
-  // Otherwise, the central one (to be skipped) is not defined.
-  if (nModulesX % 2 != 1 || nModulesY % 2 != 1) {
-    cout << "Error: number of modules per row and column must be uneven! " << nModulesX << " " << nModulesY << endl;
-    return;
-  }
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = "psd_";
-  infoFileName         = infoFileName + geoTag + ".geo.info";
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "PSD geometry " << geoTag << " created with create_psdgeo.C" << endl << endl;
-  infoFile << "Number of modules: " << nModulesX << " x " << nModulesY << endl;
-  infoFile << "Module size: " << moduleSize << " cm x " << moduleSize << " cm" << endl;
-  infoFile << "PSD translation in cave: (" << psdX << ", " << psdY << ", " << psdZ << ") cm" << endl;
-  infoFile << "PSD rotation around y axis: " << psdRotY << " degrees" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  cout << endl << "==> Reading media..." << endl;
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  // --------------------------------------------------------------------------
-
-
-  // ------   Create the required media from the media file    ----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> Air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoManager->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  cout << "Created medium: air" << endl;
-
-  // ---> Iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoManager->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: iron" << endl;
-
-  // ---> Lead
-  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  if (!mIron) Fatal("Main", "FairMedium lead not found");
-  geoBuild->createMedium(mLead);
-  TGeoMedium* lead = gGeoManager->GetMedium("lead");
-  if (!lead) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: lead" << endl;
-
-  // ---> Tyvek
-  FairGeoMedium* mTyvek = geoMedia->getMedium("PsdTyvek");
-  if (!mTyvek) Fatal("Main", "FairMedium PsdTyvek not found");
-  geoBuild->createMedium(mTyvek);
-  TGeoMedium* tyvek = gGeoManager->GetMedium("PsdTyvek");
-  if (!tyvek) Fatal("Main", "Medium PsdTyvek not found");
-  cout << "Created medium: PsdTyvek" << endl;
-
-  // ---> Scintillator
-  FairGeoMedium* mScint = geoMedia->getMedium("PsdScint");
-  if (!mScint) Fatal("Main", "FairMedium PsdScint not found");
-  geoBuild->createMedium(mScint);
-  TGeoMedium* scint = gGeoManager->GetMedium("PsdScint");
-  if (!scint) Fatal("Main", "Medium PsdScint not found");
-  cout << "Created medium: PsdScint" << endl;
-
-  // ---> Fibres
-  FairGeoMedium* mFibre = geoMedia->getMedium("PsdFibre");
-  if (!mFibre) Fatal("Main", "FairMedium PsdFibre not found");
-  geoBuild->createMedium(mFibre);
-  TGeoMedium* fibre = gGeoManager->GetMedium("PsdFibre");
-  if (!fibre) Fatal("Main", "Medium PsdFibre not found");
-  cout << "Created medium: PsdFibre" << endl;
-
-  // ---> Medium for PSD volume
-  TGeoMedium* psdMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  cout << endl << "==> Set top volume..." << endl;
-  gGeoManager->SetName("PSDgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoManager->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create the PSD modules   -----------------------------------------
-  cout << endl;
-  TGeoVolume* module2060 = ConstructModule("module2060", 20., 60, &infoFile);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create PSD volume   ------------------------------------
-  cout << endl;
-  cout << "===> Creating PSD...." << endl;
-
-  // --- Determine size of PSD box (half-lengths)
-  Double_t psdSizeX = 0.5 * nModulesX * moduleSize;
-  Double_t psdSizeY = 0.5 * nModulesY * moduleSize;
-  TGeoBBox* shape   = dynamic_cast<TGeoBBox*>(module2060->GetShape());
-  Double_t psdSizeZ = shape->GetDZ();
-
-  TString psdName = "psd_";
-  psdName += geoTag;
-  TGeoVolume* psd = gGeoManager->MakeBox(psdName, psdMedium, psdSizeX, psdSizeY, psdSizeZ);
-  cout << "Module array is " << nModulesX << " x " << nModulesY << endl;
-  cout << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm" << endl;
-  infoFile << endl
-           << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm"
-           << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place modules into the system volume   ---------------------------
-  Double_t xModCurrent = -0.5 * (nModulesX + 1) * moduleSize;
-
-  Int_t nModules = 0;
-  for (Int_t iModX = 0; iModX < nModulesX; iModX++) {
-    xModCurrent += moduleSize;
-    Double_t yModCurrent = -0.5 * (nModulesY + 1) * moduleSize;
-    for (Int_t iModY = 0; iModY < nModulesY; iModY++) {
-      yModCurrent += moduleSize;
-
-      //      // Skip edge modules
-      //      if ( ( iModX == 0 || iModX == nModulesX - 1 ) &&
-      //           ( iModY == 0 || iModY == nModulesY - 1 ) ) continue;
-      //
-      //      // Skip centre module (only for uneven number of modules)
-      //      if ( iModX == (nModulesX - 1) / 2 && iModY == (nModulesY - 1) / 2 )
-      //        continue;
-
-      // Node number and name (convention)
-      Int_t iNode = 100 * iModX + iModY;
-
-      // Position of module inside PSD
-      TGeoTranslation* trans = new TGeoTranslation(xModCurrent, yModCurrent, 0.);
-
-      psd->AddNode(module2060, iNode, trans);
-      cout << "Adding module " << setw(5) << right << iNode << " at x = " << setw(6) << right << xModCurrent
-           << " cm , y = " << setw(6) << right << yModCurrent << " cm" << endl;
-      nModules++;
-
-    }  //# modules in y direction
-  }    //# modules in x direction
-  cout << "PSD contains " << nModules << " modules." << endl;
-  infoFile << "PSD contains " << nModules << " modules." << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place PSD in top node (cave) -------------------------------------
-  TGeoRotation* psdRot = new TGeoRotation();
-  //  psdRot->RotateY(psdRotY);
-
-  // DEDE start
-  psdZ = psdZ + psdSizeZ;
-
-  // calculate mPSD x-position
-  psdX = psdZ * tan(psdRotY * acos(-1) / 180);
-  cout << "psdX at " << psdRotY << " degree angle: x= " << psdX << " cm" << endl;
-
-  // rotate around x axis
-  psdRotX = atan(psdY / sqrt(psdX * psdX + psdZ * psdZ)) * 180 / acos(-1);
-  psdRot->RotateX(-psdRotX);
-
-  cout << "angle around x: " << psdRotX << " deg" << endl;
-  cout << "y " << psdY << " t " << sqrt(psdX * psdX + psdZ * psdZ) << " cm" << endl;
-
-  // rotate around y axis
-  //  psdRotY = atan( psdX / psdZ ) * 180 / acos(-1);  // psdX is already calculated accordingly
-  psdRot->RotateY(psdRotY);
-
-  cout << "angle around y: " << psdRotY << " deg" << endl;
-  cout << "x " << psdX << " y " << psdY << " cm" << endl;
-
-  cout << endl;
-  // DEDE stop
-
-  //  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ + psdSizeZ, psdRot);
-  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ, psdRot);
-  top->AddNode(psd, 0, psdTrans);
-  cout << endl << "==> PSD position in cave: " << endl;
-  psdTrans->Print();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Close and check geometry   ---------------------------------------
-  cout << endl << "==> Closing geometry..." << endl;
-  gGeoManager->CloseGeometry();
-  gGeoManager->CheckGeometryFull();
-  cout << endl;
-  gGeoManager->CheckOverlaps(0.0001, "s");
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write PSD volume and placement matrix to geometry file   ---------
-  cout << endl;
-  TString geoFileName = "psd_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  psd->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  psdTrans->Write();
-  cout << endl;
-  cout << "==> Geometry " << psd->GetName() << " written to " << geoFileName << endl;
-  cout << "==> Info written to " << infoFileName << endl;
-  geoFile->Close();
-  infoFile.close();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write entire TGeoManager to file   -------------------------------
-  TString geoManFileName = "psd_";
-  geoManFileName         = geoManFileName + geoTag + ".geoman.root";
-  TFile* geoManFile      = new TFile(geoManFileName, "RECREATE");
-  gGeoManager->Write();
-  geoManFile->Close();
-  cout << "==> TGeoManager " << gGeoManager->GetName() << " written to " << geoManFileName << endl << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ----   Display geometry   ------------------------------------------------
-  gGeoManager->SetVisLevel(5);  // Scintillator level
-  top->Draw("ogl");
-  // --------------------------------------------------------------------------
-}
-//  End of main function
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructModule(const char* name, Double_t sizeXY, Int_t nLayers, fstream* info)
-{
-
-  // The module consists of nLayers of scintillators covered with Tyvek.
-  // Between each two scintillators, there is a lead layer (total nLayers -1).
-  // At the top, there is a gap to stretch the light fibres. This is modelled
-  // by a volume made of the same material as the scintillator (but inactive).
-  // The arrangement is surrounded by iron. At the front and at the back,
-  // there is a thick iron layer (the back one acting as first absorber)
-  // for constructional reasons.
-
-  cout << "===> Creating Module " << name << ", size " << sizeXY << " cm with " << nLayers << " layers...." << endl;
-
-  // -----   Constructional parameters   ----------------------------
-  Double_t leadD     = 1.60;  // Thickness of lead layer
-  Double_t scintD    = 0.40;  // Thickness of scintillator layer
-  Double_t tyvekD    = 0.02;  // Thickness of Tyvek wrapper around scintillator
-  Double_t boxDx     = 0.15;  // Thickness of iron box lateral
-  Double_t boxDy     = 0.05;  // Thickness of iron box top/bottom
-  Double_t boxDz     = 2.00;  // Thickness of iron box front/back
-  Double_t chanDy    = 0.20;  // Height of fibre channel
-  Double_t chanDistL = 0.50;  // Distance of channel from left edge of lead
-  Double_t chanDistR = 2.00;  // Distance of channel from right edge of lead
-  // ------------------------------------------------------------------------
-
-
-  // -----   Info to file   -------------------------------------------------
-  if (info) {
-    (*info) << "Parameters of module " << name << ": " << endl;
-    (*info) << "Size: " << sizeXY << " cm x " << sizeXY << " cm" << endl;
-    (*info) << "Number of layers: " << nLayers << endl;
-    (*info) << "Thickness of lead layers: " << leadD << " cm" << endl;
-    (*info) << "Thickness of scintillators: " << scintD << " cm" << endl;
-    (*info) << "Thickness of Tyvek wrap: " << tyvekD << " cm" << endl;
-    (*info) << "Thickness of iron box: (" << boxDx << " / " << boxDy << " / " << boxDz << ") cm" << endl;
-    (*info) << "Height of fibre channel: " << chanDy << " cm" << endl;
-    (*info) << "Distance of channel from edges: left " << chanDistL << " cm, right " << chanDistR << " cm" << endl;
-  }
-  // ------------------------------------------------------------------------
-
-
-  // -----   Get required media   -------------------------------------------
-  TGeoMedium* medAir = gGeoManager->GetMedium("air");  // PSD
-  if (!medAir) Fatal("ConstructModule", "Medium air not found");
-  TGeoMedium* medIron = gGeoManager->GetMedium("iron");  // Box
-  if (!medIron) Fatal("ConstructModule", "Medium iron not found");
-  TGeoMedium* medLead = gGeoManager->GetMedium("lead");  // Lead layers
-  if (!medLead) Fatal("ConstructModule", "Medium lead not found");
-  TGeoMedium* medTyvek = gGeoManager->GetMedium("PsdTyvek");  // Tyvek layers
-  if (!medTyvek) Fatal("ConstructModule", "Medium PsdTyvek not found");
-  TGeoMedium* medScint = gGeoManager->GetMedium("PsdScint");  // Scintillator
-  if (!medScint) Fatal("ConstructModule", "Medium PsdScint not found");
-  TGeoMedium* medFibre = gGeoManager->GetMedium("PsdFibre");  // Fibres
-  if (!medFibre) Fatal("ConstructModule", "Medium PsdFibre not found");
-  // ------------------------------------------------------------------------
-
-
-  // -----   Create module volume   -----------------------------------------
-  // Module length: nLayers of scintillators, nLayers - 1 of lead
-  // plus the iron box front and back.
-  // Material is iron.
-  Double_t moduleLength = 2. * boxDz + nLayers * (scintD + 2. * tyvekD) + (nLayers - 1) * leadD;
-  TGeoVolume* module    = gGeoManager->MakeBox(name, medIron, 0.5 * sizeXY, 0.5 * sizeXY, 0.5 * moduleLength);
-  module->SetLineColor(kRed);
-  module->Print();
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Lead filler   --------------------------------------------------
-  // The lead filler represents all lead absorber layers.
-  // The Tyvek/scintillator layers and the fibre channel will be placed
-  // inside.
-  // Dimensions are half-lengths.
-  Double_t leadLx  = 0.5 * sizeXY - boxDx;
-  Double_t leadLy  = 0.5 * sizeXY - boxDy;
-  Double_t leadLz  = 0.5 * moduleLength - boxDz;
-  TGeoVolume* lead = gGeoManager->MakeBox("lead", medLead, leadLx, leadLy, leadLz);
-  lead->SetLineColor(kBlue);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Fibre channel   ------------------------------------------------
-  // This volume represents the air gap at the top of the volume hosting the
-  // light guide fibres. The material is the same as for the scintillators
-  // (but inactive).
-  // The (half-)width of the channel is defined by the distances from the
-  // lead edges.
-  Double_t chanLx = leadLx - 0.5 * chanDistL - 0.5 * chanDistR;
-  if (chanLx < 0.) {
-    cout << "Error: lead volume is not large enough to host fibre channel!" << endl;
-    cout << "Lead width: " << 2. * leadLx << ", distance from left edge " << chanDistL << ", distance from right edge "
-         << chanDistR << endl;
-    return 0;
-  }
-  Double_t chanLy     = 0.5 * chanDy;
-  Double_t chanLz     = leadLz;
-  TGeoVolume* channel = gGeoManager->MakeBox("channel", medFibre, chanLx, chanLy, chanLz);
-  channel->SetLineColor(kMagenta);
-  // ------------------------------------------------------------------------
-
-
-  // ----   Positioning of the fibre channel   ------------------------------
-  // The channel extends from chanDistL from the left edge of the lead filler
-  // to chanDistR from its right edge (seen from the front). It is top-aligned
-  // with the lead filler.
-  Double_t chanShiftX = 0.5 * (chanDistL - chanDistR);
-  Double_t chanShiftY = leadLy - 0.5 * chanDy;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Tyvek layer   --------------------------------------------------
-  // The scintillator will be placed inside this, leaving only the thin
-  // Tyvek as a wrapper. Since these layers will be placed in the lead filler,
-  // there has to be a cut-out for the fibre channel.
-  Double_t tyvekLz        = 0.5 * scintD + tyvekD;  // half-length
-  TGeoBBox* tyv1          = new TGeoBBox("psdTyv1", leadLx, leadLy, tyvekLz);
-  TGeoBBox* tyv2          = new TGeoBBox("psdTyv2", chanLx, chanLy, tyvekLz);
-  TGeoTranslation* trans1 = new TGeoTranslation("tPsd1", chanShiftX, chanShiftY, 0.);
-  trans1->RegisterYourself();
-  TGeoCompositeShape* tyvekShape = new TGeoCompositeShape("psdTyv1-psdTyv2:tPsd1");
-  TGeoVolume* tyvek              = new TGeoVolume("tyvek", tyvekShape, medTyvek);
-  tyvek->SetLineColor(kGreen);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Scintillator layer   -------------------------------------------
-  // The scintillator layer is embedded (as daughter) into the Tyvek layer.
-  // It is also a box minus the cut-out for the fibres. The cut-out is
-  // slightly smaller than for the Tyvek volume.
-  Double_t scintLx        = leadLx - tyvekD;
-  Double_t scintLy        = leadLy - tyvekD;
-  Double_t scintLz        = 0.5 * scintD;
-  TGeoBBox* sci1          = new TGeoBBox("sci1", scintLx, scintLy, scintLz);
-  Double_t cutLx          = chanLx;
-  Double_t cutLy          = chanLy - tyvekD;
-  Double_t cutLz          = scintLz;
-  TGeoBBox* sci2          = new TGeoBBox("sci2", cutLx, cutLy, cutLz);
-  Double_t cutShiftX      = chanShiftX;
-  Double_t cutShiftY      = scintLy - cutLy;
-  TGeoTranslation* trans2 = new TGeoTranslation("tPsd2", cutShiftX, cutShiftY, 0.);
-  trans2->RegisterYourself();
-  TGeoCompositeShape* scintShape = new TGeoCompositeShape("scintShape", "sci1-sci2:tPsd2");
-  TGeoVolume* scint              = new TGeoVolume("scint", scintShape, medScint);
-  scint->SetLineColor(kBlack);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Place volumes   ------------------------------------------------
-
-  // ---> Scintillator into Tyvek
-  tyvek->AddNode(scint, 0);
-
-  // ---> Fibre channel into lead filler
-  lead->AddNode(channel, 0, trans1);
-
-  // --->  Tyvek layers into lead
-  Double_t zFirst = 0.;
-  Double_t zLast  = 0.;
-  for (Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
-    Double_t zPos = -1. * leadLz + iLayer * leadD + (2. * iLayer + 1.) * tyvekLz;
-    if (iLayer == 0) zFirst = zPos;
-    if (iLayer == nLayers - 1) zLast = zPos;
-    lead->AddNode(tyvek, iLayer, new TGeoTranslation(0., 0., zPos));
-  }
-  cout << module->GetName() << ": Positioned " << nLayers << " Tyvek layers; first at z = " << zFirst
-       << ", last at z = " << zLast << endl;
-
-  // ---> Lead into module
-  module->AddNode(lead, 0);
-  // ------------------------------------------------------------------------
-
-  return module;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/psd/create_psdgeo_v18b.C b/macro/mcbm/geometry/psd/create_psdgeo_v18b.C
deleted file mode 100644
index d1f0532834..0000000000
--- a/macro/mcbm/geometry/psd/create_psdgeo_v18b.C
+++ /dev/null
@@ -1,473 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/** @file create_psdgeo_v18b.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 16 September 2017
- ** @version 1.0
- **
- ** This macro creates a PSD geometry in ROOT format to be used as input
- ** for the transport simulation. It allows to create module stacks of
- ** varying sizes; the numbers of rows and columns must both be uneven.
- ** The centre module as well as the edge modules are omitted.
- ** The module definition is implemented in the function ConstructModule.
- **
- ** The user can adjust the steering variables to the specific needs.
- **
- ** 2017-12-04 - DE - v18b - place 3x3-1 modules around the beampipe, downstream of mTRD
- ** 2017-12-02 - DE - v18a - adapted mPSD, single module to mCBM setup
- **
- **/
-
-
-using std::cout;
-using std::endl;
-using std::fstream;
-using std::right;
-using std::setw;
-
-// Forward declarations
-TGeoVolume* ConstructModule(const char* name, Double_t moduleSize, Int_t nLayers, fstream* info = 0);
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_psdgeo_v18b()
-{
-
-  // -----   Steering variables   ---------------------------------------------
-  const char* geoTag = "v18b_mcbm";  // geometry tag
-
-  Double_t psdX       = 0.;    // x position is automatically determined from psdRotY
-  Double_t psdY       = 0.;    // y position of PSD in cave
-  Double_t psdZ       = 210.;  // z position of PSD in cave (back side)
-  Double_t psdRotX    = 0.;    // Rotation of PSD around x axis [degrees]
-  Double_t psdRotY    = 20.;   // Rotation of PSD around y axis [degrees]
-  Double_t moduleSize = 20.;   // Module size [cm]
-  Int_t nModulesX     = 3;     // Number of modules in a row (x direction)
-  Int_t nModulesY     = 3;     // Number of modules in a row (x direction)
-  // --------------------------------------------------------------------------
-
-
-  // ---- Number of modules per row/column must be uneven ---------------------
-  // Otherwise, the central one (to be skipped) is not defined.
-  if (nModulesX % 2 != 1 || nModulesY % 2 != 1) {
-    cout << "Error: number of modules per row and column must be uneven! " << nModulesX << " " << nModulesY << endl;
-    return;
-  }
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = "psd_";
-  infoFileName         = infoFileName + geoTag + ".geo.info";
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "PSD geometry " << geoTag << " created with create_psdgeo.C" << endl << endl;
-  infoFile << "Number of modules: " << nModulesX << " x " << nModulesY << endl;
-  infoFile << "Module size: " << moduleSize << " cm x " << moduleSize << " cm" << endl;
-  infoFile << "PSD translation in cave: (" << psdX << ", " << psdY << ", " << psdZ << ") cm" << endl;
-  infoFile << "PSD rotation around y axis: " << psdRotY << " degrees" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  cout << endl << "==> Reading media..." << endl;
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  // --------------------------------------------------------------------------
-
-
-  // ------   Create the required media from the media file    ----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> Air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoManager->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  cout << "Created medium: air" << endl;
-
-  // ---> Iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoManager->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: iron" << endl;
-
-  // ---> Lead
-  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  if (!mIron) Fatal("Main", "FairMedium lead not found");
-  geoBuild->createMedium(mLead);
-  TGeoMedium* lead = gGeoManager->GetMedium("lead");
-  if (!lead) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: lead" << endl;
-
-  // ---> Tyvek
-  FairGeoMedium* mTyvek = geoMedia->getMedium("PsdTyvek");
-  if (!mTyvek) Fatal("Main", "FairMedium PsdTyvek not found");
-  geoBuild->createMedium(mTyvek);
-  TGeoMedium* tyvek = gGeoManager->GetMedium("PsdTyvek");
-  if (!tyvek) Fatal("Main", "Medium PsdTyvek not found");
-  cout << "Created medium: PsdTyvek" << endl;
-
-  // ---> Scintillator
-  FairGeoMedium* mScint = geoMedia->getMedium("PsdScint");
-  if (!mScint) Fatal("Main", "FairMedium PsdScint not found");
-  geoBuild->createMedium(mScint);
-  TGeoMedium* scint = gGeoManager->GetMedium("PsdScint");
-  if (!scint) Fatal("Main", "Medium PsdScint not found");
-  cout << "Created medium: PsdScint" << endl;
-
-  // ---> Fibres
-  FairGeoMedium* mFibre = geoMedia->getMedium("PsdFibre");
-  if (!mFibre) Fatal("Main", "FairMedium PsdFibre not found");
-  geoBuild->createMedium(mFibre);
-  TGeoMedium* fibre = gGeoManager->GetMedium("PsdFibre");
-  if (!fibre) Fatal("Main", "Medium PsdFibre not found");
-  cout << "Created medium: PsdFibre" << endl;
-
-  // ---> Medium for PSD volume
-  TGeoMedium* psdMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  cout << endl << "==> Set top volume..." << endl;
-  gGeoManager->SetName("PSDgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoManager->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create the PSD modules   -----------------------------------------
-  cout << endl;
-  TGeoVolume* module2060 = ConstructModule("module2060", 20., 60, &infoFile);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create PSD volume   ------------------------------------
-  cout << endl;
-  cout << "===> Creating PSD...." << endl;
-
-  // --- Determine size of PSD box (half-lengths)
-  Double_t psdSizeX = 0.5 * nModulesX * moduleSize;
-  Double_t psdSizeY = 0.5 * nModulesY * moduleSize;
-  TGeoBBox* shape   = dynamic_cast<TGeoBBox*>(module2060->GetShape());
-  Double_t psdSizeZ = shape->GetDZ();
-
-  TString psdName = "psd_";
-  psdName += geoTag;
-
-  TGeoVolume* psd = new TGeoVolumeAssembly(psdName);
-
-  //  TGeoVolume* psd = gGeoManager->MakeBox(psdName, psdMedium, psdSizeX,
-  //                                         psdSizeY, psdSizeZ);
-  cout << "Module array is " << nModulesX << " x " << nModulesY << endl;
-  cout << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm" << endl;
-  infoFile << endl
-           << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm"
-           << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place modules into the system volume   ---------------------------
-  Double_t xModCurrent = -0.5 * (nModulesX + 1) * moduleSize;
-
-  Int_t nModules = 0;
-  for (Int_t iModX = 0; iModX < nModulesX; iModX++) {
-    xModCurrent += moduleSize;
-    Double_t yModCurrent = -0.5 * (nModulesY + 1) * moduleSize;
-    for (Int_t iModY = 0; iModY < nModulesY; iModY++) {
-      yModCurrent += moduleSize;
-
-      //      // Skip edge modules
-      //      if ( ( iModX == 0 || iModX == nModulesX - 1 ) &&
-      //           ( iModY == 0 || iModY == nModulesY - 1 ) ) continue;
-      //
-      // Skip centre module (only for uneven number of modules)
-      if (iModX == (nModulesX - 1) / 2 && iModY == (nModulesY - 1) / 2) continue;
-
-      // Node number and name (convention)
-      Int_t iNode = 100 * iModX + iModY;
-
-      // Position of module inside PSD
-      TGeoTranslation* trans = new TGeoTranslation(xModCurrent, yModCurrent, 0.);
-
-      psd->AddNode(module2060, iNode, trans);
-      cout << "Adding module " << setw(5) << right << iNode << " at x = " << setw(6) << right << xModCurrent
-           << " cm , y = " << setw(6) << right << yModCurrent << " cm" << endl;
-      nModules++;
-
-    }  //# modules in y direction
-  }    //# modules in x direction
-  cout << "PSD contains " << nModules << " modules." << endl;
-  infoFile << "PSD contains " << nModules << " modules." << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place PSD in top node (cave) -------------------------------------
-  TGeoRotation* psdRot = new TGeoRotation();
-  //  psdRot->RotateY(psdRotY);
-
-  // DEDE start
-  psdZ = psdZ + psdSizeZ;
-
-  // calculate mPSD x-position
-  psdX = psdZ * tan(psdRotY * acos(-1) / 180);
-  cout << "psdX at " << psdRotY << " degree angle: x= " << psdX << " cm" << endl;
-
-  // rotate around x axis
-  psdRotX = atan(psdY / sqrt(psdX * psdX + psdZ * psdZ)) * 180 / acos(-1);
-  psdRot->RotateX(-psdRotX);
-
-  cout << "angle around x: " << psdRotX << " deg" << endl;
-  cout << "y " << psdY << " t " << sqrt(psdX * psdX + psdZ * psdZ) << " cm" << endl;
-
-  // rotate around y axis
-  //  psdRotY = atan( psdX / psdZ ) * 180 / acos(-1);  // psdX is already calculated accordingly
-  psdRot->RotateY(psdRotY);
-
-  cout << "angle around y: " << psdRotY << " deg" << endl;
-  cout << "x " << psdX << " y " << psdY << " cm" << endl;
-
-  cout << endl;
-  // DEDE stop
-
-  //  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ + psdSizeZ, psdRot);
-  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ, psdRot);
-  top->AddNode(psd, 0, psdTrans);
-  cout << endl << "==> PSD position in cave: " << endl;
-  psdTrans->Print();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Close and check geometry   ---------------------------------------
-  cout << endl << "==> Closing geometry..." << endl;
-  gGeoManager->CloseGeometry();
-  gGeoManager->CheckGeometryFull();
-  cout << endl;
-  gGeoManager->CheckOverlaps(0.0001, "s");
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write PSD volume and placement matrix to geometry file   ---------
-  cout << endl;
-  TString geoFileName = "psd_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  psd->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  psdTrans->Write();
-  cout << endl;
-  cout << "==> Geometry " << psd->GetName() << " written to " << geoFileName << endl;
-  cout << "==> Info written to " << infoFileName << endl;
-  geoFile->Close();
-  infoFile.close();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write entire TGeoManager to file   -------------------------------
-  TString geoManFileName = "psd_";
-  geoManFileName         = geoManFileName + geoTag + ".geoman.root";
-  TFile* geoManFile      = new TFile(geoManFileName, "RECREATE");
-  gGeoManager->Write();
-  geoManFile->Close();
-  cout << "==> TGeoManager " << gGeoManager->GetName() << " written to " << geoManFileName << endl << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ----   Display geometry   ------------------------------------------------
-  gGeoManager->SetVisLevel(5);  // Scintillator level
-  top->Draw("ogl");
-  // --------------------------------------------------------------------------
-}
-//  End of main function
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructModule(const char* name, Double_t sizeXY, Int_t nLayers, fstream* info)
-{
-
-  // The module consists of nLayers of scintillators covered with Tyvek.
-  // Between each two scintillators, there is a lead layer (total nLayers -1).
-  // At the top, there is a gap to stretch the light fibres. This is modelled
-  // by a volume made of the same material as the scintillator (but inactive).
-  // The arrangement is surrounded by iron. At the front and at the back,
-  // there is a thick iron layer (the back one acting as first absorber)
-  // for constructional reasons.
-
-  cout << "===> Creating Module " << name << ", size " << sizeXY << " cm with " << nLayers << " layers...." << endl;
-
-  // -----   Constructional parameters   ----------------------------
-  Double_t leadD     = 1.60;  // Thickness of lead layer
-  Double_t scintD    = 0.40;  // Thickness of scintillator layer
-  Double_t tyvekD    = 0.02;  // Thickness of Tyvek wrapper around scintillator
-  Double_t boxDx     = 0.15;  // Thickness of iron box lateral
-  Double_t boxDy     = 0.05;  // Thickness of iron box top/bottom
-  Double_t boxDz     = 2.00;  // Thickness of iron box front/back
-  Double_t chanDy    = 0.20;  // Height of fibre channel
-  Double_t chanDistL = 0.50;  // Distance of channel from left edge of lead
-  Double_t chanDistR = 2.00;  // Distance of channel from right edge of lead
-  // ------------------------------------------------------------------------
-
-
-  // -----   Info to file   -------------------------------------------------
-  if (info) {
-    (*info) << "Parameters of module " << name << ": " << endl;
-    (*info) << "Size: " << sizeXY << " cm x " << sizeXY << " cm" << endl;
-    (*info) << "Number of layers: " << nLayers << endl;
-    (*info) << "Thickness of lead layers: " << leadD << " cm" << endl;
-    (*info) << "Thickness of scintillators: " << scintD << " cm" << endl;
-    (*info) << "Thickness of Tyvek wrap: " << tyvekD << " cm" << endl;
-    (*info) << "Thickness of iron box: (" << boxDx << " / " << boxDy << " / " << boxDz << ") cm" << endl;
-    (*info) << "Height of fibre channel: " << chanDy << " cm" << endl;
-    (*info) << "Distance of channel from edges: left " << chanDistL << " cm, right " << chanDistR << " cm" << endl;
-  }
-  // ------------------------------------------------------------------------
-
-
-  // -----   Get required media   -------------------------------------------
-  TGeoMedium* medAir = gGeoManager->GetMedium("air");  // PSD
-  if (!medAir) Fatal("ConstructModule", "Medium air not found");
-  TGeoMedium* medIron = gGeoManager->GetMedium("iron");  // Box
-  if (!medIron) Fatal("ConstructModule", "Medium iron not found");
-  TGeoMedium* medLead = gGeoManager->GetMedium("lead");  // Lead layers
-  if (!medLead) Fatal("ConstructModule", "Medium lead not found");
-  TGeoMedium* medTyvek = gGeoManager->GetMedium("PsdTyvek");  // Tyvek layers
-  if (!medTyvek) Fatal("ConstructModule", "Medium PsdTyvek not found");
-  TGeoMedium* medScint = gGeoManager->GetMedium("PsdScint");  // Scintillator
-  if (!medScint) Fatal("ConstructModule", "Medium PsdScint not found");
-  TGeoMedium* medFibre = gGeoManager->GetMedium("PsdFibre");  // Fibres
-  if (!medFibre) Fatal("ConstructModule", "Medium PsdFibre not found");
-  // ------------------------------------------------------------------------
-
-
-  // -----   Create module volume   -----------------------------------------
-  // Module length: nLayers of scintillators, nLayers - 1 of lead
-  // plus the iron box front and back.
-  // Material is iron.
-  Double_t moduleLength = 2. * boxDz + nLayers * (scintD + 2. * tyvekD) + (nLayers - 1) * leadD;
-  TGeoVolume* module    = gGeoManager->MakeBox(name, medIron, 0.5 * sizeXY, 0.5 * sizeXY, 0.5 * moduleLength);
-  module->SetLineColor(kRed);
-  module->Print();
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Lead filler   --------------------------------------------------
-  // The lead filler represents all lead absorber layers.
-  // The Tyvek/scintillator layers and the fibre channel will be placed
-  // inside.
-  // Dimensions are half-lengths.
-  Double_t leadLx  = 0.5 * sizeXY - boxDx;
-  Double_t leadLy  = 0.5 * sizeXY - boxDy;
-  Double_t leadLz  = 0.5 * moduleLength - boxDz;
-  TGeoVolume* lead = gGeoManager->MakeBox("lead", medLead, leadLx, leadLy, leadLz);
-  lead->SetLineColor(kBlue);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Fibre channel   ------------------------------------------------
-  // This volume represents the air gap at the top of the volume hosting the
-  // light guide fibres. The material is the same as for the scintillators
-  // (but inactive).
-  // The (half-)width of the channel is defined by the distances from the
-  // lead edges.
-  Double_t chanLx = leadLx - 0.5 * chanDistL - 0.5 * chanDistR;
-  if (chanLx < 0.) {
-    cout << "Error: lead volume is not large enough to host fibre channel!" << endl;
-    cout << "Lead width: " << 2. * leadLx << ", distance from left edge " << chanDistL << ", distance from right edge "
-         << chanDistR << endl;
-    return 0;
-  }
-  Double_t chanLy     = 0.5 * chanDy;
-  Double_t chanLz     = leadLz;
-  TGeoVolume* channel = gGeoManager->MakeBox("channel", medFibre, chanLx, chanLy, chanLz);
-  channel->SetLineColor(kMagenta);
-  // ------------------------------------------------------------------------
-
-
-  // ----   Positioning of the fibre channel   ------------------------------
-  // The channel extends from chanDistL from the left edge of the lead filler
-  // to chanDistR from its right edge (seen from the front). It is top-aligned
-  // with the lead filler.
-  Double_t chanShiftX = 0.5 * (chanDistL - chanDistR);
-  Double_t chanShiftY = leadLy - 0.5 * chanDy;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Tyvek layer   --------------------------------------------------
-  // The scintillator will be placed inside this, leaving only the thin
-  // Tyvek as a wrapper. Since these layers will be placed in the lead filler,
-  // there has to be a cut-out for the fibre channel.
-  Double_t tyvekLz        = 0.5 * scintD + tyvekD;  // half-length
-  TGeoBBox* tyv1          = new TGeoBBox("psdTyv1", leadLx, leadLy, tyvekLz);
-  TGeoBBox* tyv2          = new TGeoBBox("psdTyv2", chanLx, chanLy, tyvekLz);
-  TGeoTranslation* trans1 = new TGeoTranslation("tPsd1", chanShiftX, chanShiftY, 0.);
-  trans1->RegisterYourself();
-  TGeoCompositeShape* tyvekShape = new TGeoCompositeShape("psdTyv1-psdTyv2:tPsd1");
-  TGeoVolume* tyvek              = new TGeoVolume("tyvek", tyvekShape, medTyvek);
-  tyvek->SetLineColor(kGreen);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Scintillator layer   -------------------------------------------
-  // The scintillator layer is embedded (as daughter) into the Tyvek layer.
-  // It is also a box minus the cut-out for the fibres. The cut-out is
-  // slightly smaller than for the Tyvek volume.
-  Double_t scintLx        = leadLx - tyvekD;
-  Double_t scintLy        = leadLy - tyvekD;
-  Double_t scintLz        = 0.5 * scintD;
-  TGeoBBox* sci1          = new TGeoBBox("sci1", scintLx, scintLy, scintLz);
-  Double_t cutLx          = chanLx;
-  Double_t cutLy          = chanLy - tyvekD;
-  Double_t cutLz          = scintLz;
-  TGeoBBox* sci2          = new TGeoBBox("sci2", cutLx, cutLy, cutLz);
-  Double_t cutShiftX      = chanShiftX;
-  Double_t cutShiftY      = scintLy - cutLy;
-  TGeoTranslation* trans2 = new TGeoTranslation("tPsd2", cutShiftX, cutShiftY, 0.);
-  trans2->RegisterYourself();
-  TGeoCompositeShape* scintShape = new TGeoCompositeShape("scintShape", "sci1-sci2:tPsd2");
-  TGeoVolume* scint              = new TGeoVolume("scint", scintShape, medScint);
-  scint->SetLineColor(kBlack);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Place volumes   ------------------------------------------------
-
-  // ---> Scintillator into Tyvek
-  tyvek->AddNode(scint, 0);
-
-  // ---> Fibre channel into lead filler
-  lead->AddNode(channel, 0, trans1);
-
-  // --->  Tyvek layers into lead
-  Double_t zFirst = 0.;
-  Double_t zLast  = 0.;
-  for (Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
-    Double_t zPos = -1. * leadLz + iLayer * leadD + (2. * iLayer + 1.) * tyvekLz;
-    if (iLayer == 0) zFirst = zPos;
-    if (iLayer == nLayers - 1) zLast = zPos;
-    lead->AddNode(tyvek, iLayer, new TGeoTranslation(0., 0., zPos));
-  }
-  cout << module->GetName() << ": Positioned " << nLayers << " Tyvek layers; first at z = " << zFirst
-       << ", last at z = " << zLast << endl;
-
-  // ---> Lead into module
-  module->AddNode(lead, 0);
-  // ------------------------------------------------------------------------
-
-  return module;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/psd/create_psdgeo_v18c.C b/macro/mcbm/geometry/psd/create_psdgeo_v18c.C
deleted file mode 100644
index 35851d4ebc..0000000000
--- a/macro/mcbm/geometry/psd/create_psdgeo_v18c.C
+++ /dev/null
@@ -1,470 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/** @file create_psdgeo_v18c.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 16 September 2017
- ** @version 1.0
- **
- ** This macro creates a PSD geometry in ROOT format to be used as input
- ** for the transport simulation. It allows to create module stacks of
- ** varying sizes; the numbers of rows and columns must both be uneven.
- ** The centre module as well as the edge modules are omitted.
- ** The module definition is implemented in the function ConstructModule.
- **
- ** The user can adjust the steering variables to the specific needs.
- **
- ** 2017-12-05 - DE - v18c - place single module very close beneath the beampipe
- ** 2017-12-02 - DE - v18a - adapted mPSD, single module to mCBM setup
- **
- **/
-
-
-using std::cout;
-using std::endl;
-using std::fstream;
-using std::right;
-using std::setw;
-
-// Forward declarations
-TGeoVolume* ConstructModule(const char* name, Double_t moduleSize, Int_t nLayers, fstream* info = 0);
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_psdgeo_v18c()
-{
-
-  // -----   Steering variables   ---------------------------------------------
-  const char* geoTag = "v18c_mcbm";  // geometry tag
-
-  Double_t psdX       = 0.;    // x position is automatically determined from psdRotY
-  Double_t psdY       = -22.;  // y position of PSD in cave
-  Double_t psdZ       = 160.;  // z position of PSD in cave (back side)
-  Double_t psdRotX    = 0.;    // Rotation of PSD around x axis [degrees]
-  Double_t psdRotY    = 20.;   // Rotation of PSD around y axis [degrees]
-  Double_t moduleSize = 20.;   // Module size [cm]
-  Int_t nModulesX     = 1;     // Number of modules in a row (x direction)
-  Int_t nModulesY     = 1;     // Number of modules in a row (x direction)
-  // --------------------------------------------------------------------------
-
-
-  // ---- Number of modules per row/column must be uneven ---------------------
-  // Otherwise, the central one (to be skipped) is not defined.
-  if (nModulesX % 2 != 1 || nModulesY % 2 != 1) {
-    cout << "Error: number of modules per row and column must be uneven! " << nModulesX << " " << nModulesY << endl;
-    return;
-  }
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = "psd_";
-  infoFileName         = infoFileName + geoTag + ".geo.info";
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "PSD geometry " << geoTag << " created with create_psdgeo.C" << endl << endl;
-  infoFile << "Number of modules: " << nModulesX << " x " << nModulesY << endl;
-  infoFile << "Module size: " << moduleSize << " cm x " << moduleSize << " cm" << endl;
-  infoFile << "PSD translation in cave: (" << psdX << ", " << psdY << ", " << psdZ << ") cm" << endl;
-  infoFile << "PSD rotation around y axis: " << psdRotY << " degrees" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  cout << endl << "==> Reading media..." << endl;
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  // --------------------------------------------------------------------------
-
-
-  // ------   Create the required media from the media file    ----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> Air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoManager->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  cout << "Created medium: air" << endl;
-
-  // ---> Iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoManager->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: iron" << endl;
-
-  // ---> Lead
-  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  if (!mIron) Fatal("Main", "FairMedium lead not found");
-  geoBuild->createMedium(mLead);
-  TGeoMedium* lead = gGeoManager->GetMedium("lead");
-  if (!lead) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: lead" << endl;
-
-  // ---> Tyvek
-  FairGeoMedium* mTyvek = geoMedia->getMedium("PsdTyvek");
-  if (!mTyvek) Fatal("Main", "FairMedium PsdTyvek not found");
-  geoBuild->createMedium(mTyvek);
-  TGeoMedium* tyvek = gGeoManager->GetMedium("PsdTyvek");
-  if (!tyvek) Fatal("Main", "Medium PsdTyvek not found");
-  cout << "Created medium: PsdTyvek" << endl;
-
-  // ---> Scintillator
-  FairGeoMedium* mScint = geoMedia->getMedium("PsdScint");
-  if (!mScint) Fatal("Main", "FairMedium PsdScint not found");
-  geoBuild->createMedium(mScint);
-  TGeoMedium* scint = gGeoManager->GetMedium("PsdScint");
-  if (!scint) Fatal("Main", "Medium PsdScint not found");
-  cout << "Created medium: PsdScint" << endl;
-
-  // ---> Fibres
-  FairGeoMedium* mFibre = geoMedia->getMedium("PsdFibre");
-  if (!mFibre) Fatal("Main", "FairMedium PsdFibre not found");
-  geoBuild->createMedium(mFibre);
-  TGeoMedium* fibre = gGeoManager->GetMedium("PsdFibre");
-  if (!fibre) Fatal("Main", "Medium PsdFibre not found");
-  cout << "Created medium: PsdFibre" << endl;
-
-  // ---> Medium for PSD volume
-  TGeoMedium* psdMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  cout << endl << "==> Set top volume..." << endl;
-  gGeoManager->SetName("PSDgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoManager->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create the PSD modules   -----------------------------------------
-  cout << endl;
-  TGeoVolume* module2060 = ConstructModule("module2060", 20., 60, &infoFile);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create PSD volume   ------------------------------------
-  cout << endl;
-  cout << "===> Creating PSD...." << endl;
-
-  // --- Determine size of PSD box (half-lengths)
-  Double_t psdSizeX = 0.5 * nModulesX * moduleSize;
-  Double_t psdSizeY = 0.5 * nModulesY * moduleSize;
-  TGeoBBox* shape   = dynamic_cast<TGeoBBox*>(module2060->GetShape());
-  Double_t psdSizeZ = shape->GetDZ();
-
-  TString psdName = "psd_";
-  psdName += geoTag;
-  TGeoVolume* psd = gGeoManager->MakeBox(psdName, psdMedium, psdSizeX, psdSizeY, psdSizeZ);
-  cout << "Module array is " << nModulesX << " x " << nModulesY << endl;
-  cout << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm" << endl;
-  infoFile << endl
-           << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm"
-           << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place modules into the system volume   ---------------------------
-  Double_t xModCurrent = -0.5 * (nModulesX + 1) * moduleSize;
-
-  Int_t nModules = 0;
-  for (Int_t iModX = 0; iModX < nModulesX; iModX++) {
-    xModCurrent += moduleSize;
-    Double_t yModCurrent = -0.5 * (nModulesY + 1) * moduleSize;
-    for (Int_t iModY = 0; iModY < nModulesY; iModY++) {
-      yModCurrent += moduleSize;
-
-      //      // Skip edge modules
-      //      if ( ( iModX == 0 || iModX == nModulesX - 1 ) &&
-      //           ( iModY == 0 || iModY == nModulesY - 1 ) ) continue;
-      //
-      //      // Skip centre module (only for uneven number of modules)
-      //      if ( iModX == (nModulesX - 1) / 2 && iModY == (nModulesY - 1) / 2 )
-      //        continue;
-
-      // Node number and name (convention)
-      Int_t iNode = 100 * iModX + iModY;
-
-      // Position of module inside PSD
-      TGeoTranslation* trans = new TGeoTranslation(xModCurrent, yModCurrent, 0.);
-
-      psd->AddNode(module2060, iNode, trans);
-      cout << "Adding module " << setw(5) << right << iNode << " at x = " << setw(6) << right << xModCurrent
-           << " cm , y = " << setw(6) << right << yModCurrent << " cm" << endl;
-      nModules++;
-
-    }  //# modules in y direction
-  }    //# modules in x direction
-  cout << "PSD contains " << nModules << " modules." << endl;
-  infoFile << "PSD contains " << nModules << " modules." << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place PSD in top node (cave) -------------------------------------
-  TGeoRotation* psdRot = new TGeoRotation();
-  //  psdRot->RotateY(psdRotY);
-
-  // DEDE start
-  psdZ = psdZ + psdSizeZ;
-
-  // calculate mPSD x-position
-  psdX = psdZ * tan(psdRotY * acos(-1) / 180);
-  cout << "psdX at " << psdRotY << " degree angle: x= " << psdX << " cm" << endl;
-
-  // rotate around x axis
-  psdRotX = atan(psdY / sqrt(psdX * psdX + psdZ * psdZ)) * 180 / acos(-1);
-  psdRot->RotateX(-psdRotX);
-
-  cout << "angle around x: " << psdRotX << " deg" << endl;
-  cout << "y " << psdY << " t " << sqrt(psdX * psdX + psdZ * psdZ) << " cm" << endl;
-
-  // rotate around y axis
-  //  psdRotY = atan( psdX / psdZ ) * 180 / acos(-1);  // psdX is already calculated accordingly
-  psdRot->RotateY(psdRotY);
-
-  cout << "angle around y: " << psdRotY << " deg" << endl;
-  cout << "x " << psdX << " y " << psdY << " cm" << endl;
-
-  cout << endl;
-  // DEDE stop
-
-  //  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ + psdSizeZ, psdRot);
-  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ, psdRot);
-  top->AddNode(psd, 0, psdTrans);
-  cout << endl << "==> PSD position in cave: " << endl;
-  psdTrans->Print();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Close and check geometry   ---------------------------------------
-  cout << endl << "==> Closing geometry..." << endl;
-  gGeoManager->CloseGeometry();
-  gGeoManager->CheckGeometryFull();
-  cout << endl;
-  gGeoManager->CheckOverlaps(0.0001, "s");
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write PSD volume and placement matrix to geometry file   ---------
-  cout << endl;
-  TString geoFileName = "psd_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  psd->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  psdTrans->Write();
-  cout << endl;
-  cout << "==> Geometry " << psd->GetName() << " written to " << geoFileName << endl;
-  cout << "==> Info written to " << infoFileName << endl;
-  geoFile->Close();
-  infoFile.close();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write entire TGeoManager to file   -------------------------------
-  TString geoManFileName = "psd_";
-  geoManFileName         = geoManFileName + geoTag + ".geoman.root";
-  TFile* geoManFile      = new TFile(geoManFileName, "RECREATE");
-  gGeoManager->Write();
-  geoManFile->Close();
-  cout << "==> TGeoManager " << gGeoManager->GetName() << " written to " << geoManFileName << endl << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ----   Display geometry   ------------------------------------------------
-  gGeoManager->SetVisLevel(5);  // Scintillator level
-  top->Draw("ogl");
-  // --------------------------------------------------------------------------
-}
-//  End of main function
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructModule(const char* name, Double_t sizeXY, Int_t nLayers, fstream* info)
-{
-
-  // The module consists of nLayers of scintillators covered with Tyvek.
-  // Between each two scintillators, there is a lead layer (total nLayers -1).
-  // At the top, there is a gap to stretch the light fibres. This is modelled
-  // by a volume made of the same material as the scintillator (but inactive).
-  // The arrangement is surrounded by iron. At the front and at the back,
-  // there is a thick iron layer (the back one acting as first absorber)
-  // for constructional reasons.
-
-  cout << "===> Creating Module " << name << ", size " << sizeXY << " cm with " << nLayers << " layers...." << endl;
-
-  // -----   Constructional parameters   ----------------------------
-  Double_t leadD     = 1.60;  // Thickness of lead layer
-  Double_t scintD    = 0.40;  // Thickness of scintillator layer
-  Double_t tyvekD    = 0.02;  // Thickness of Tyvek wrapper around scintillator
-  Double_t boxDx     = 0.15;  // Thickness of iron box lateral
-  Double_t boxDy     = 0.05;  // Thickness of iron box top/bottom
-  Double_t boxDz     = 2.00;  // Thickness of iron box front/back
-  Double_t chanDy    = 0.20;  // Height of fibre channel
-  Double_t chanDistL = 0.50;  // Distance of channel from left edge of lead
-  Double_t chanDistR = 2.00;  // Distance of channel from right edge of lead
-  // ------------------------------------------------------------------------
-
-
-  // -----   Info to file   -------------------------------------------------
-  if (info) {
-    (*info) << "Parameters of module " << name << ": " << endl;
-    (*info) << "Size: " << sizeXY << " cm x " << sizeXY << " cm" << endl;
-    (*info) << "Number of layers: " << nLayers << endl;
-    (*info) << "Thickness of lead layers: " << leadD << " cm" << endl;
-    (*info) << "Thickness of scintillators: " << scintD << " cm" << endl;
-    (*info) << "Thickness of Tyvek wrap: " << tyvekD << " cm" << endl;
-    (*info) << "Thickness of iron box: (" << boxDx << " / " << boxDy << " / " << boxDz << ") cm" << endl;
-    (*info) << "Height of fibre channel: " << chanDy << " cm" << endl;
-    (*info) << "Distance of channel from edges: left " << chanDistL << " cm, right " << chanDistR << " cm" << endl;
-  }
-  // ------------------------------------------------------------------------
-
-
-  // -----   Get required media   -------------------------------------------
-  TGeoMedium* medAir = gGeoManager->GetMedium("air");  // PSD
-  if (!medAir) Fatal("ConstructModule", "Medium air not found");
-  TGeoMedium* medIron = gGeoManager->GetMedium("iron");  // Box
-  if (!medIron) Fatal("ConstructModule", "Medium iron not found");
-  TGeoMedium* medLead = gGeoManager->GetMedium("lead");  // Lead layers
-  if (!medLead) Fatal("ConstructModule", "Medium lead not found");
-  TGeoMedium* medTyvek = gGeoManager->GetMedium("PsdTyvek");  // Tyvek layers
-  if (!medTyvek) Fatal("ConstructModule", "Medium PsdTyvek not found");
-  TGeoMedium* medScint = gGeoManager->GetMedium("PsdScint");  // Scintillator
-  if (!medScint) Fatal("ConstructModule", "Medium PsdScint not found");
-  TGeoMedium* medFibre = gGeoManager->GetMedium("PsdFibre");  // Fibres
-  if (!medFibre) Fatal("ConstructModule", "Medium PsdFibre not found");
-  // ------------------------------------------------------------------------
-
-
-  // -----   Create module volume   -----------------------------------------
-  // Module length: nLayers of scintillators, nLayers - 1 of lead
-  // plus the iron box front and back.
-  // Material is iron.
-  Double_t moduleLength = 2. * boxDz + nLayers * (scintD + 2. * tyvekD) + (nLayers - 1) * leadD;
-  TGeoVolume* module    = gGeoManager->MakeBox(name, medIron, 0.5 * sizeXY, 0.5 * sizeXY, 0.5 * moduleLength);
-  module->SetLineColor(kRed);
-  module->Print();
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Lead filler   --------------------------------------------------
-  // The lead filler represents all lead absorber layers.
-  // The Tyvek/scintillator layers and the fibre channel will be placed
-  // inside.
-  // Dimensions are half-lengths.
-  Double_t leadLx  = 0.5 * sizeXY - boxDx;
-  Double_t leadLy  = 0.5 * sizeXY - boxDy;
-  Double_t leadLz  = 0.5 * moduleLength - boxDz;
-  TGeoVolume* lead = gGeoManager->MakeBox("lead", medLead, leadLx, leadLy, leadLz);
-  lead->SetLineColor(kBlue);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Fibre channel   ------------------------------------------------
-  // This volume represents the air gap at the top of the volume hosting the
-  // light guide fibres. The material is the same as for the scintillators
-  // (but inactive).
-  // The (half-)width of the channel is defined by the distances from the
-  // lead edges.
-  Double_t chanLx = leadLx - 0.5 * chanDistL - 0.5 * chanDistR;
-  if (chanLx < 0.) {
-    cout << "Error: lead volume is not large enough to host fibre channel!" << endl;
-    cout << "Lead width: " << 2. * leadLx << ", distance from left edge " << chanDistL << ", distance from right edge "
-         << chanDistR << endl;
-    return 0;
-  }
-  Double_t chanLy     = 0.5 * chanDy;
-  Double_t chanLz     = leadLz;
-  TGeoVolume* channel = gGeoManager->MakeBox("channel", medFibre, chanLx, chanLy, chanLz);
-  channel->SetLineColor(kMagenta);
-  // ------------------------------------------------------------------------
-
-
-  // ----   Positioning of the fibre channel   ------------------------------
-  // The channel extends from chanDistL from the left edge of the lead filler
-  // to chanDistR from its right edge (seen from the front). It is top-aligned
-  // with the lead filler.
-  Double_t chanShiftX = 0.5 * (chanDistL - chanDistR);
-  Double_t chanShiftY = leadLy - 0.5 * chanDy;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Tyvek layer   --------------------------------------------------
-  // The scintillator will be placed inside this, leaving only the thin
-  // Tyvek as a wrapper. Since these layers will be placed in the lead filler,
-  // there has to be a cut-out for the fibre channel.
-  Double_t tyvekLz        = 0.5 * scintD + tyvekD;  // half-length
-  TGeoBBox* tyv1          = new TGeoBBox("psdTyv1", leadLx, leadLy, tyvekLz);
-  TGeoBBox* tyv2          = new TGeoBBox("psdTyv2", chanLx, chanLy, tyvekLz);
-  TGeoTranslation* trans1 = new TGeoTranslation("tPsd1", chanShiftX, chanShiftY, 0.);
-  trans1->RegisterYourself();
-  TGeoCompositeShape* tyvekShape = new TGeoCompositeShape("psdTyv1-psdTyv2:tPsd1");
-  TGeoVolume* tyvek              = new TGeoVolume("tyvek", tyvekShape, medTyvek);
-  tyvek->SetLineColor(kGreen);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Scintillator layer   -------------------------------------------
-  // The scintillator layer is embedded (as daughter) into the Tyvek layer.
-  // It is also a box minus the cut-out for the fibres. The cut-out is
-  // slightly smaller than for the Tyvek volume.
-  Double_t scintLx        = leadLx - tyvekD;
-  Double_t scintLy        = leadLy - tyvekD;
-  Double_t scintLz        = 0.5 * scintD;
-  TGeoBBox* sci1          = new TGeoBBox("sci1", scintLx, scintLy, scintLz);
-  Double_t cutLx          = chanLx;
-  Double_t cutLy          = chanLy - tyvekD;
-  Double_t cutLz          = scintLz;
-  TGeoBBox* sci2          = new TGeoBBox("sci2", cutLx, cutLy, cutLz);
-  Double_t cutShiftX      = chanShiftX;
-  Double_t cutShiftY      = scintLy - cutLy;
-  TGeoTranslation* trans2 = new TGeoTranslation("tPsd2", cutShiftX, cutShiftY, 0.);
-  trans2->RegisterYourself();
-  TGeoCompositeShape* scintShape = new TGeoCompositeShape("scintShape", "sci1-sci2:tPsd2");
-  TGeoVolume* scint              = new TGeoVolume("scint", scintShape, medScint);
-  scint->SetLineColor(kBlack);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Place volumes   ------------------------------------------------
-
-  // ---> Scintillator into Tyvek
-  tyvek->AddNode(scint, 0);
-
-  // ---> Fibre channel into lead filler
-  lead->AddNode(channel, 0, trans1);
-
-  // --->  Tyvek layers into lead
-  Double_t zFirst = 0.;
-  Double_t zLast  = 0.;
-  for (Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
-    Double_t zPos = -1. * leadLz + iLayer * leadD + (2. * iLayer + 1.) * tyvekLz;
-    if (iLayer == 0) zFirst = zPos;
-    if (iLayer == nLayers - 1) zLast = zPos;
-    lead->AddNode(tyvek, iLayer, new TGeoTranslation(0., 0., zPos));
-  }
-  cout << module->GetName() << ": Positioned " << nLayers << " Tyvek layers; first at z = " << zFirst
-       << ", last at z = " << zLast << endl;
-
-  // ---> Lead into module
-  module->AddNode(lead, 0);
-  // ------------------------------------------------------------------------
-
-  return module;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/psd/create_psdgeo_v18d.C b/macro/mcbm/geometry/psd/create_psdgeo_v18d.C
deleted file mode 100644
index 8a39472400..0000000000
--- a/macro/mcbm/geometry/psd/create_psdgeo_v18d.C
+++ /dev/null
@@ -1,471 +0,0 @@
-/* Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/** @file create_psdgeo_v18d.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 16 September 2017
- ** @version 1.0
- **
- ** This macro creates a PSD geometry in ROOT format to be used as input
- ** for the transport simulation. It allows to create module stacks of
- ** varying sizes; the numbers of rows and columns must both be uneven.
- ** The centre module as well as the edge modules are omitted.
- ** The module definition is implemented in the function ConstructModule.
- **
- ** The user can adjust the steering variables to the specific needs.
- **
- ** 2018-05-24 - DE - v18d - move PSD from 20 to 25 degrees
- ** 2017-12-05 - DE - v18c - place single module very close beneath the beampipe
- ** 2017-12-02 - DE - v18a - adapted mPSD, single module to mCBM setup
- **
- **/
-
-
-using std::cout;
-using std::endl;
-using std::fstream;
-using std::right;
-using std::setw;
-
-// Forward declarations
-TGeoVolume* ConstructModule(const char* name, Double_t moduleSize, Int_t nLayers, fstream* info = 0);
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_psdgeo_v18d()
-{
-
-  // -----   Steering variables   ---------------------------------------------
-  const char* geoTag = "v18d_mcbm";  // geometry tag
-
-  Double_t psdX       = 0.;    // x position is automatically determined from psdRotY
-  Double_t psdY       = -22.;  // y position of PSD in cave
-  Double_t psdZ       = 160.;  // z position of PSD in cave (back side)
-  Double_t psdRotX    = 0.;    // Rotation of PSD around x axis [degrees]
-  Double_t psdRotY    = 25.;   // Rotation of PSD around y axis [degrees]
-  Double_t moduleSize = 20.;   // Module size [cm]
-  Int_t nModulesX     = 1;     // Number of modules in a row (x direction)
-  Int_t nModulesY     = 1;     // Number of modules in a row (x direction)
-  // --------------------------------------------------------------------------
-
-
-  // ---- Number of modules per row/column must be uneven ---------------------
-  // Otherwise, the central one (to be skipped) is not defined.
-  if (nModulesX % 2 != 1 || nModulesY % 2 != 1) {
-    cout << "Error: number of modules per row and column must be uneven! " << nModulesX << " " << nModulesY << endl;
-    return;
-  }
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = "psd_";
-  infoFileName         = infoFileName + geoTag + ".geo.info";
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "PSD geometry " << geoTag << " created with create_psdgeo.C" << endl << endl;
-  infoFile << "Number of modules: " << nModulesX << " x " << nModulesY << endl;
-  infoFile << "Module size: " << moduleSize << " cm x " << moduleSize << " cm" << endl;
-  infoFile << "PSD translation in cave: (" << psdX << ", " << psdY << ", " << psdZ << ") cm" << endl;
-  infoFile << "PSD rotation around y axis: " << psdRotY << " degrees" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  cout << endl << "==> Reading media..." << endl;
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  // --------------------------------------------------------------------------
-
-
-  // ------   Create the required media from the media file    ----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> Air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoManager->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  cout << "Created medium: air" << endl;
-
-  // ---> Iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoManager->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: iron" << endl;
-
-  // ---> Lead
-  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  if (!mIron) Fatal("Main", "FairMedium lead not found");
-  geoBuild->createMedium(mLead);
-  TGeoMedium* lead = gGeoManager->GetMedium("lead");
-  if (!lead) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: lead" << endl;
-
-  // ---> Tyvek
-  FairGeoMedium* mTyvek = geoMedia->getMedium("PsdTyvek");
-  if (!mTyvek) Fatal("Main", "FairMedium PsdTyvek not found");
-  geoBuild->createMedium(mTyvek);
-  TGeoMedium* tyvek = gGeoManager->GetMedium("PsdTyvek");
-  if (!tyvek) Fatal("Main", "Medium PsdTyvek not found");
-  cout << "Created medium: PsdTyvek" << endl;
-
-  // ---> Scintillator
-  FairGeoMedium* mScint = geoMedia->getMedium("PsdScint");
-  if (!mScint) Fatal("Main", "FairMedium PsdScint not found");
-  geoBuild->createMedium(mScint);
-  TGeoMedium* scint = gGeoManager->GetMedium("PsdScint");
-  if (!scint) Fatal("Main", "Medium PsdScint not found");
-  cout << "Created medium: PsdScint" << endl;
-
-  // ---> Fibres
-  FairGeoMedium* mFibre = geoMedia->getMedium("PsdFibre");
-  if (!mFibre) Fatal("Main", "FairMedium PsdFibre not found");
-  geoBuild->createMedium(mFibre);
-  TGeoMedium* fibre = gGeoManager->GetMedium("PsdFibre");
-  if (!fibre) Fatal("Main", "Medium PsdFibre not found");
-  cout << "Created medium: PsdFibre" << endl;
-
-  // ---> Medium for PSD volume
-  TGeoMedium* psdMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  cout << endl << "==> Set top volume..." << endl;
-  gGeoManager->SetName("PSDgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoManager->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create the PSD modules   -----------------------------------------
-  cout << endl;
-  TGeoVolume* module2060 = ConstructModule("module2060", 20., 60, &infoFile);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create PSD volume   ------------------------------------
-  cout << endl;
-  cout << "===> Creating PSD...." << endl;
-
-  // --- Determine size of PSD box (half-lengths)
-  Double_t psdSizeX = 0.5 * nModulesX * moduleSize;
-  Double_t psdSizeY = 0.5 * nModulesY * moduleSize;
-  TGeoBBox* shape   = dynamic_cast<TGeoBBox*>(module2060->GetShape());
-  Double_t psdSizeZ = shape->GetDZ();
-
-  TString psdName = "psd_";
-  psdName += geoTag;
-  TGeoVolume* psd = gGeoManager->MakeBox(psdName, psdMedium, psdSizeX, psdSizeY, psdSizeZ);
-  cout << "Module array is " << nModulesX << " x " << nModulesY << endl;
-  cout << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm" << endl;
-  infoFile << endl
-           << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm"
-           << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place modules into the system volume   ---------------------------
-  Double_t xModCurrent = -0.5 * (nModulesX + 1) * moduleSize;
-
-  Int_t nModules = 0;
-  for (Int_t iModX = 0; iModX < nModulesX; iModX++) {
-    xModCurrent += moduleSize;
-    Double_t yModCurrent = -0.5 * (nModulesY + 1) * moduleSize;
-    for (Int_t iModY = 0; iModY < nModulesY; iModY++) {
-      yModCurrent += moduleSize;
-
-      //      // Skip edge modules
-      //      if ( ( iModX == 0 || iModX == nModulesX - 1 ) &&
-      //           ( iModY == 0 || iModY == nModulesY - 1 ) ) continue;
-      //
-      //      // Skip centre module (only for uneven number of modules)
-      //      if ( iModX == (nModulesX - 1) / 2 && iModY == (nModulesY - 1) / 2 )
-      //        continue;
-
-      // Node number and name (convention)
-      Int_t iNode = 100 * iModX + iModY;
-
-      // Position of module inside PSD
-      TGeoTranslation* trans = new TGeoTranslation(xModCurrent, yModCurrent, 0.);
-
-      psd->AddNode(module2060, iNode, trans);
-      cout << "Adding module " << setw(5) << right << iNode << " at x = " << setw(6) << right << xModCurrent
-           << " cm , y = " << setw(6) << right << yModCurrent << " cm" << endl;
-      nModules++;
-
-    }  //# modules in y direction
-  }    //# modules in x direction
-  cout << "PSD contains " << nModules << " modules." << endl;
-  infoFile << "PSD contains " << nModules << " modules." << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place PSD in top node (cave) -------------------------------------
-  TGeoRotation* psdRot = new TGeoRotation();
-  //  psdRot->RotateY(psdRotY);
-
-  // DEDE start
-  psdZ = psdZ + psdSizeZ;
-
-  // calculate mPSD x-position
-  psdX = psdZ * tan(psdRotY * acos(-1) / 180);
-  cout << "psdX at " << psdRotY << " degree angle: x= " << psdX << " cm" << endl;
-
-  // rotate around x axis
-  psdRotX = atan(psdY / sqrt(psdX * psdX + psdZ * psdZ)) * 180 / acos(-1);
-  psdRot->RotateX(-psdRotX);
-
-  cout << "angle around x: " << psdRotX << " deg" << endl;
-  cout << "y " << psdY << " t " << sqrt(psdX * psdX + psdZ * psdZ) << " cm" << endl;
-
-  // rotate around y axis
-  //  psdRotY = atan( psdX / psdZ ) * 180 / acos(-1);  // psdX is already calculated accordingly
-  psdRot->RotateY(psdRotY);
-
-  cout << "angle around y: " << psdRotY << " deg" << endl;
-  cout << "x " << psdX << " y " << psdY << " cm" << endl;
-
-  cout << endl;
-  // DEDE stop
-
-  //  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ + psdSizeZ, psdRot);
-  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ, psdRot);
-  top->AddNode(psd, 0, psdTrans);
-  cout << endl << "==> PSD position in cave: " << endl;
-  psdTrans->Print();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Close and check geometry   ---------------------------------------
-  cout << endl << "==> Closing geometry..." << endl;
-  gGeoManager->CloseGeometry();
-  gGeoManager->CheckGeometryFull();
-  cout << endl;
-  gGeoManager->CheckOverlaps(0.0001, "s");
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write PSD volume and placement matrix to geometry file   ---------
-  cout << endl;
-  TString geoFileName = "psd_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  psd->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  psdTrans->Write();
-  cout << endl;
-  cout << "==> Geometry " << psd->GetName() << " written to " << geoFileName << endl;
-  cout << "==> Info written to " << infoFileName << endl;
-  geoFile->Close();
-  infoFile.close();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write entire TGeoManager to file   -------------------------------
-  TString geoManFileName = "psd_";
-  geoManFileName         = geoManFileName + geoTag + ".geoman.root";
-  TFile* geoManFile      = new TFile(geoManFileName, "RECREATE");
-  gGeoManager->Write();
-  geoManFile->Close();
-  cout << "==> TGeoManager " << gGeoManager->GetName() << " written to " << geoManFileName << endl << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ----   Display geometry   ------------------------------------------------
-  gGeoManager->SetVisLevel(5);  // Scintillator level
-  top->Draw("ogl");
-  // --------------------------------------------------------------------------
-}
-//  End of main function
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructModule(const char* name, Double_t sizeXY, Int_t nLayers, fstream* info)
-{
-
-  // The module consists of nLayers of scintillators covered with Tyvek.
-  // Between each two scintillators, there is a lead layer (total nLayers -1).
-  // At the top, there is a gap to stretch the light fibres. This is modelled
-  // by a volume made of the same material as the scintillator (but inactive).
-  // The arrangement is surrounded by iron. At the front and at the back,
-  // there is a thick iron layer (the back one acting as first absorber)
-  // for constructional reasons.
-
-  cout << "===> Creating Module " << name << ", size " << sizeXY << " cm with " << nLayers << " layers...." << endl;
-
-  // -----   Constructional parameters   ----------------------------
-  Double_t leadD     = 1.60;  // Thickness of lead layer
-  Double_t scintD    = 0.40;  // Thickness of scintillator layer
-  Double_t tyvekD    = 0.02;  // Thickness of Tyvek wrapper around scintillator
-  Double_t boxDx     = 0.15;  // Thickness of iron box lateral
-  Double_t boxDy     = 0.05;  // Thickness of iron box top/bottom
-  Double_t boxDz     = 2.00;  // Thickness of iron box front/back
-  Double_t chanDy    = 0.20;  // Height of fibre channel
-  Double_t chanDistL = 0.50;  // Distance of channel from left edge of lead
-  Double_t chanDistR = 2.00;  // Distance of channel from right edge of lead
-  // ------------------------------------------------------------------------
-
-
-  // -----   Info to file   -------------------------------------------------
-  if (info) {
-    (*info) << "Parameters of module " << name << ": " << endl;
-    (*info) << "Size: " << sizeXY << " cm x " << sizeXY << " cm" << endl;
-    (*info) << "Number of layers: " << nLayers << endl;
-    (*info) << "Thickness of lead layers: " << leadD << " cm" << endl;
-    (*info) << "Thickness of scintillators: " << scintD << " cm" << endl;
-    (*info) << "Thickness of Tyvek wrap: " << tyvekD << " cm" << endl;
-    (*info) << "Thickness of iron box: (" << boxDx << " / " << boxDy << " / " << boxDz << ") cm" << endl;
-    (*info) << "Height of fibre channel: " << chanDy << " cm" << endl;
-    (*info) << "Distance of channel from edges: left " << chanDistL << " cm, right " << chanDistR << " cm" << endl;
-  }
-  // ------------------------------------------------------------------------
-
-
-  // -----   Get required media   -------------------------------------------
-  TGeoMedium* medAir = gGeoManager->GetMedium("air");  // PSD
-  if (!medAir) Fatal("ConstructModule", "Medium air not found");
-  TGeoMedium* medIron = gGeoManager->GetMedium("iron");  // Box
-  if (!medIron) Fatal("ConstructModule", "Medium iron not found");
-  TGeoMedium* medLead = gGeoManager->GetMedium("lead");  // Lead layers
-  if (!medLead) Fatal("ConstructModule", "Medium lead not found");
-  TGeoMedium* medTyvek = gGeoManager->GetMedium("PsdTyvek");  // Tyvek layers
-  if (!medTyvek) Fatal("ConstructModule", "Medium PsdTyvek not found");
-  TGeoMedium* medScint = gGeoManager->GetMedium("PsdScint");  // Scintillator
-  if (!medScint) Fatal("ConstructModule", "Medium PsdScint not found");
-  TGeoMedium* medFibre = gGeoManager->GetMedium("PsdFibre");  // Fibres
-  if (!medFibre) Fatal("ConstructModule", "Medium PsdFibre not found");
-  // ------------------------------------------------------------------------
-
-
-  // -----   Create module volume   -----------------------------------------
-  // Module length: nLayers of scintillators, nLayers - 1 of lead
-  // plus the iron box front and back.
-  // Material is iron.
-  Double_t moduleLength = 2. * boxDz + nLayers * (scintD + 2. * tyvekD) + (nLayers - 1) * leadD;
-  TGeoVolume* module    = gGeoManager->MakeBox(name, medIron, 0.5 * sizeXY, 0.5 * sizeXY, 0.5 * moduleLength);
-  module->SetLineColor(kRed);
-  module->Print();
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Lead filler   --------------------------------------------------
-  // The lead filler represents all lead absorber layers.
-  // The Tyvek/scintillator layers and the fibre channel will be placed
-  // inside.
-  // Dimensions are half-lengths.
-  Double_t leadLx  = 0.5 * sizeXY - boxDx;
-  Double_t leadLy  = 0.5 * sizeXY - boxDy;
-  Double_t leadLz  = 0.5 * moduleLength - boxDz;
-  TGeoVolume* lead = gGeoManager->MakeBox("lead", medLead, leadLx, leadLy, leadLz);
-  lead->SetLineColor(kBlue);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Fibre channel   ------------------------------------------------
-  // This volume represents the air gap at the top of the volume hosting the
-  // light guide fibres. The material is the same as for the scintillators
-  // (but inactive).
-  // The (half-)width of the channel is defined by the distances from the
-  // lead edges.
-  Double_t chanLx = leadLx - 0.5 * chanDistL - 0.5 * chanDistR;
-  if (chanLx < 0.) {
-    cout << "Error: lead volume is not large enough to host fibre channel!" << endl;
-    cout << "Lead width: " << 2. * leadLx << ", distance from left edge " << chanDistL << ", distance from right edge "
-         << chanDistR << endl;
-    return 0;
-  }
-  Double_t chanLy     = 0.5 * chanDy;
-  Double_t chanLz     = leadLz;
-  TGeoVolume* channel = gGeoManager->MakeBox("channel", medFibre, chanLx, chanLy, chanLz);
-  channel->SetLineColor(kMagenta);
-  // ------------------------------------------------------------------------
-
-
-  // ----   Positioning of the fibre channel   ------------------------------
-  // The channel extends from chanDistL from the left edge of the lead filler
-  // to chanDistR from its right edge (seen from the front). It is top-aligned
-  // with the lead filler.
-  Double_t chanShiftX = 0.5 * (chanDistL - chanDistR);
-  Double_t chanShiftY = leadLy - 0.5 * chanDy;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Tyvek layer   --------------------------------------------------
-  // The scintillator will be placed inside this, leaving only the thin
-  // Tyvek as a wrapper. Since these layers will be placed in the lead filler,
-  // there has to be a cut-out for the fibre channel.
-  Double_t tyvekLz        = 0.5 * scintD + tyvekD;  // half-length
-  TGeoBBox* tyv1          = new TGeoBBox("psdTyv1", leadLx, leadLy, tyvekLz);
-  TGeoBBox* tyv2          = new TGeoBBox("psdTyv2", chanLx, chanLy, tyvekLz);
-  TGeoTranslation* trans1 = new TGeoTranslation("tPsd1", chanShiftX, chanShiftY, 0.);
-  trans1->RegisterYourself();
-  TGeoCompositeShape* tyvekShape = new TGeoCompositeShape("psdTyv1-psdTyv2:tPsd1");
-  TGeoVolume* tyvek              = new TGeoVolume("tyvek", tyvekShape, medTyvek);
-  tyvek->SetLineColor(kGreen);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Scintillator layer   -------------------------------------------
-  // The scintillator layer is embedded (as daughter) into the Tyvek layer.
-  // It is also a box minus the cut-out for the fibres. The cut-out is
-  // slightly smaller than for the Tyvek volume.
-  Double_t scintLx        = leadLx - tyvekD;
-  Double_t scintLy        = leadLy - tyvekD;
-  Double_t scintLz        = 0.5 * scintD;
-  TGeoBBox* sci1          = new TGeoBBox("sci1", scintLx, scintLy, scintLz);
-  Double_t cutLx          = chanLx;
-  Double_t cutLy          = chanLy - tyvekD;
-  Double_t cutLz          = scintLz;
-  TGeoBBox* sci2          = new TGeoBBox("sci2", cutLx, cutLy, cutLz);
-  Double_t cutShiftX      = chanShiftX;
-  Double_t cutShiftY      = scintLy - cutLy;
-  TGeoTranslation* trans2 = new TGeoTranslation("tPsd2", cutShiftX, cutShiftY, 0.);
-  trans2->RegisterYourself();
-  TGeoCompositeShape* scintShape = new TGeoCompositeShape("scintShape", "sci1-sci2:tPsd2");
-  TGeoVolume* scint              = new TGeoVolume("scint", scintShape, medScint);
-  scint->SetLineColor(kBlack);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Place volumes   ------------------------------------------------
-
-  // ---> Scintillator into Tyvek
-  tyvek->AddNode(scint, 0);
-
-  // ---> Fibre channel into lead filler
-  lead->AddNode(channel, 0, trans1);
-
-  // --->  Tyvek layers into lead
-  Double_t zFirst = 0.;
-  Double_t zLast  = 0.;
-  for (Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
-    Double_t zPos = -1. * leadLz + iLayer * leadD + (2. * iLayer + 1.) * tyvekLz;
-    if (iLayer == 0) zFirst = zPos;
-    if (iLayer == nLayers - 1) zLast = zPos;
-    lead->AddNode(tyvek, iLayer, new TGeoTranslation(0., 0., zPos));
-  }
-  cout << module->GetName() << ": Positioned " << nLayers << " Tyvek layers; first at z = " << zFirst
-       << ", last at z = " << zLast << endl;
-
-  // ---> Lead into module
-  module->AddNode(lead, 0);
-  // ------------------------------------------------------------------------
-
-  return module;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/psd/create_psdgeo_v18e.C b/macro/mcbm/geometry/psd/create_psdgeo_v18e.C
deleted file mode 100644
index 4eb6d26d90..0000000000
--- a/macro/mcbm/geometry/psd/create_psdgeo_v18e.C
+++ /dev/null
@@ -1,472 +0,0 @@
-/* Copyright (C) 2017-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/** @file create_psdgeo_v18e.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 16 September 2017
- ** @version 1.0
- **
- ** This macro creates a PSD geometry in ROOT format to be used as input
- ** for the transport simulation. It allows to create module stacks of
- ** varying sizes; the numbers of rows and columns must both be uneven.
- ** The centre module as well as the edge modules are omitted.
- ** The module definition is implemented in the function ConstructModule.
- **
- ** The user can adjust the steering variables to the specific needs.
- **
- ** 2019-12-11 - DE - v18e - move PSD from 25 to 28 degrees
- ** 2018-05-24 - DE - v18d - move PSD from 20 to 25 degrees
- ** 2017-12-05 - DE - v18c - place single module very close beneath the beampipe
- ** 2017-12-02 - DE - v18a - adapted mPSD, single module to mCBM setup
- **
- **/
-
-
-using std::cout;
-using std::endl;
-using std::fstream;
-using std::right;
-using std::setw;
-
-// Forward declarations
-TGeoVolume* ConstructModule(const char* name, Double_t moduleSize, Int_t nLayers, fstream* info = 0);
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_psdgeo_v18e()
-{
-
-  // -----   Steering variables   ---------------------------------------------
-  const char* geoTag = "v18e_mcbm";  // geometry tag
-
-  Double_t psdX       = 0.;    // x position is automatically determined from psdRotY
-  Double_t psdY       = -22.;  // y position of PSD in cave
-  Double_t psdZ       = 160.;  // z position of PSD in cave (back side)
-  Double_t psdRotX    = 0.;    // Rotation of PSD around x axis [degrees]
-  Double_t psdRotY    = 28.;   // Rotation of PSD around y axis [degrees]
-  Double_t moduleSize = 20.;   // Module size [cm]
-  Int_t nModulesX     = 1;     // Number of modules in a row (x direction)
-  Int_t nModulesY     = 1;     // Number of modules in a row (x direction)
-  // --------------------------------------------------------------------------
-
-
-  // ---- Number of modules per row/column must be uneven ---------------------
-  // Otherwise, the central one (to be skipped) is not defined.
-  if (nModulesX % 2 != 1 || nModulesY % 2 != 1) {
-    cout << "Error: number of modules per row and column must be uneven! " << nModulesX << " " << nModulesY << endl;
-    return;
-  }
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = "psd_";
-  infoFileName         = infoFileName + geoTag + ".geo.info";
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "PSD geometry " << geoTag << " created with create_psdgeo.C" << endl << endl;
-  infoFile << "Number of modules: " << nModulesX << " x " << nModulesY << endl;
-  infoFile << "Module size: " << moduleSize << " cm x " << moduleSize << " cm" << endl;
-  infoFile << "PSD translation in cave: (" << psdX << ", " << psdY << ", " << psdZ << ") cm" << endl;
-  infoFile << "PSD rotation around y axis: " << psdRotY << " degrees" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  cout << endl << "==> Reading media..." << endl;
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  // --------------------------------------------------------------------------
-
-
-  // ------   Create the required media from the media file    ----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> Air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoManager->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  cout << "Created medium: air" << endl;
-
-  // ---> Iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoManager->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: iron" << endl;
-
-  // ---> Lead
-  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  if (!mIron) Fatal("Main", "FairMedium lead not found");
-  geoBuild->createMedium(mLead);
-  TGeoMedium* lead = gGeoManager->GetMedium("lead");
-  if (!lead) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: lead" << endl;
-
-  // ---> Tyvek
-  FairGeoMedium* mTyvek = geoMedia->getMedium("PsdTyvek");
-  if (!mTyvek) Fatal("Main", "FairMedium PsdTyvek not found");
-  geoBuild->createMedium(mTyvek);
-  TGeoMedium* tyvek = gGeoManager->GetMedium("PsdTyvek");
-  if (!tyvek) Fatal("Main", "Medium PsdTyvek not found");
-  cout << "Created medium: PsdTyvek" << endl;
-
-  // ---> Scintillator
-  FairGeoMedium* mScint = geoMedia->getMedium("PsdScint");
-  if (!mScint) Fatal("Main", "FairMedium PsdScint not found");
-  geoBuild->createMedium(mScint);
-  TGeoMedium* scint = gGeoManager->GetMedium("PsdScint");
-  if (!scint) Fatal("Main", "Medium PsdScint not found");
-  cout << "Created medium: PsdScint" << endl;
-
-  // ---> Fibres
-  FairGeoMedium* mFibre = geoMedia->getMedium("PsdFibre");
-  if (!mFibre) Fatal("Main", "FairMedium PsdFibre not found");
-  geoBuild->createMedium(mFibre);
-  TGeoMedium* fibre = gGeoManager->GetMedium("PsdFibre");
-  if (!fibre) Fatal("Main", "Medium PsdFibre not found");
-  cout << "Created medium: PsdFibre" << endl;
-
-  // ---> Medium for PSD volume
-  TGeoMedium* psdMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  cout << endl << "==> Set top volume..." << endl;
-  gGeoManager->SetName("PSDgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoManager->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create the PSD modules   -----------------------------------------
-  cout << endl;
-  TGeoVolume* module2060 = ConstructModule("module2060", 20., 60, &infoFile);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create PSD volume   ------------------------------------
-  cout << endl;
-  cout << "===> Creating PSD...." << endl;
-
-  // --- Determine size of PSD box (half-lengths)
-  Double_t psdSizeX = 0.5 * nModulesX * moduleSize;
-  Double_t psdSizeY = 0.5 * nModulesY * moduleSize;
-  TGeoBBox* shape   = dynamic_cast<TGeoBBox*>(module2060->GetShape());
-  Double_t psdSizeZ = shape->GetDZ();
-
-  TString psdName = "psd_";
-  psdName += geoTag;
-  TGeoVolume* psd = gGeoManager->MakeBox(psdName, psdMedium, psdSizeX, psdSizeY, psdSizeZ);
-  cout << "Module array is " << nModulesX << " x " << nModulesY << endl;
-  cout << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm" << endl;
-  infoFile << endl
-           << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm"
-           << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place modules into the system volume   ---------------------------
-  Double_t xModCurrent = -0.5 * (nModulesX + 1) * moduleSize;
-
-  Int_t nModules = 0;
-  for (Int_t iModX = 0; iModX < nModulesX; iModX++) {
-    xModCurrent += moduleSize;
-    Double_t yModCurrent = -0.5 * (nModulesY + 1) * moduleSize;
-    for (Int_t iModY = 0; iModY < nModulesY; iModY++) {
-      yModCurrent += moduleSize;
-
-      //      // Skip edge modules
-      //      if ( ( iModX == 0 || iModX == nModulesX - 1 ) &&
-      //           ( iModY == 0 || iModY == nModulesY - 1 ) ) continue;
-      //
-      //      // Skip centre module (only for uneven number of modules)
-      //      if ( iModX == (nModulesX - 1) / 2 && iModY == (nModulesY - 1) / 2 )
-      //        continue;
-
-      // Node number and name (convention)
-      Int_t iNode = 100 * iModX + iModY;
-
-      // Position of module inside PSD
-      TGeoTranslation* trans = new TGeoTranslation(xModCurrent, yModCurrent, 0.);
-
-      psd->AddNode(module2060, iNode, trans);
-      cout << "Adding module " << setw(5) << right << iNode << " at x = " << setw(6) << right << xModCurrent
-           << " cm , y = " << setw(6) << right << yModCurrent << " cm" << endl;
-      nModules++;
-
-    }  //# modules in y direction
-  }    //# modules in x direction
-  cout << "PSD contains " << nModules << " modules." << endl;
-  infoFile << "PSD contains " << nModules << " modules." << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place PSD in top node (cave) -------------------------------------
-  TGeoRotation* psdRot = new TGeoRotation();
-  //  psdRot->RotateY(psdRotY);
-
-  // DEDE start
-  psdZ = psdZ + psdSizeZ;
-
-  // calculate mPSD x-position
-  psdX = psdZ * tan(psdRotY * acos(-1) / 180);
-  cout << "psdX at " << psdRotY << " degree angle: x= " << psdX << " cm" << endl;
-
-  // rotate around x axis
-  psdRotX = atan(psdY / sqrt(psdX * psdX + psdZ * psdZ)) * 180 / acos(-1);
-  psdRot->RotateX(-psdRotX);
-
-  cout << "angle around x: " << psdRotX << " deg" << endl;
-  cout << "y " << psdY << " t " << sqrt(psdX * psdX + psdZ * psdZ) << " cm" << endl;
-
-  // rotate around y axis
-  //  psdRotY = atan( psdX / psdZ ) * 180 / acos(-1);  // psdX is already calculated accordingly
-  psdRot->RotateY(psdRotY);
-
-  cout << "angle around y: " << psdRotY << " deg" << endl;
-  cout << "x " << psdX << " y " << psdY << " cm" << endl;
-
-  cout << endl;
-  // DEDE stop
-
-  //  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ + psdSizeZ, psdRot);
-  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ, psdRot);
-  top->AddNode(psd, 0, psdTrans);
-  cout << endl << "==> PSD position in cave: " << endl;
-  psdTrans->Print();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Close and check geometry   ---------------------------------------
-  cout << endl << "==> Closing geometry..." << endl;
-  gGeoManager->CloseGeometry();
-  gGeoManager->CheckGeometryFull();
-  cout << endl;
-  gGeoManager->CheckOverlaps(0.0001, "s");
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write PSD volume and placement matrix to geometry file   ---------
-  cout << endl;
-  TString geoFileName = "psd_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  psd->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  psdTrans->Write();
-  cout << endl;
-  cout << "==> Geometry " << psd->GetName() << " written to " << geoFileName << endl;
-  cout << "==> Info written to " << infoFileName << endl;
-  geoFile->Close();
-  infoFile.close();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write entire TGeoManager to file   -------------------------------
-  TString geoManFileName = "psd_";
-  geoManFileName         = geoManFileName + geoTag + ".geoman.root";
-  TFile* geoManFile      = new TFile(geoManFileName, "RECREATE");
-  gGeoManager->Write();
-  geoManFile->Close();
-  cout << "==> TGeoManager " << gGeoManager->GetName() << " written to " << geoManFileName << endl << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ----   Display geometry   ------------------------------------------------
-  gGeoManager->SetVisLevel(5);  // Scintillator level
-  top->Draw("ogl");
-  // --------------------------------------------------------------------------
-}
-//  End of main function
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructModule(const char* name, Double_t sizeXY, Int_t nLayers, fstream* info)
-{
-
-  // The module consists of nLayers of scintillators covered with Tyvek.
-  // Between each two scintillators, there is a lead layer (total nLayers -1).
-  // At the top, there is a gap to stretch the light fibres. This is modelled
-  // by a volume made of the same material as the scintillator (but inactive).
-  // The arrangement is surrounded by iron. At the front and at the back,
-  // there is a thick iron layer (the back one acting as first absorber)
-  // for constructional reasons.
-
-  cout << "===> Creating Module " << name << ", size " << sizeXY << " cm with " << nLayers << " layers...." << endl;
-
-  // -----   Constructional parameters   ----------------------------
-  Double_t leadD     = 1.60;  // Thickness of lead layer
-  Double_t scintD    = 0.40;  // Thickness of scintillator layer
-  Double_t tyvekD    = 0.02;  // Thickness of Tyvek wrapper around scintillator
-  Double_t boxDx     = 0.15;  // Thickness of iron box lateral
-  Double_t boxDy     = 0.05;  // Thickness of iron box top/bottom
-  Double_t boxDz     = 2.00;  // Thickness of iron box front/back
-  Double_t chanDy    = 0.20;  // Height of fibre channel
-  Double_t chanDistL = 0.50;  // Distance of channel from left edge of lead
-  Double_t chanDistR = 2.00;  // Distance of channel from right edge of lead
-  // ------------------------------------------------------------------------
-
-
-  // -----   Info to file   -------------------------------------------------
-  if (info) {
-    (*info) << "Parameters of module " << name << ": " << endl;
-    (*info) << "Size: " << sizeXY << " cm x " << sizeXY << " cm" << endl;
-    (*info) << "Number of layers: " << nLayers << endl;
-    (*info) << "Thickness of lead layers: " << leadD << " cm" << endl;
-    (*info) << "Thickness of scintillators: " << scintD << " cm" << endl;
-    (*info) << "Thickness of Tyvek wrap: " << tyvekD << " cm" << endl;
-    (*info) << "Thickness of iron box: (" << boxDx << " / " << boxDy << " / " << boxDz << ") cm" << endl;
-    (*info) << "Height of fibre channel: " << chanDy << " cm" << endl;
-    (*info) << "Distance of channel from edges: left " << chanDistL << " cm, right " << chanDistR << " cm" << endl;
-  }
-  // ------------------------------------------------------------------------
-
-
-  // -----   Get required media   -------------------------------------------
-  TGeoMedium* medAir = gGeoManager->GetMedium("air");  // PSD
-  if (!medAir) Fatal("ConstructModule", "Medium air not found");
-  TGeoMedium* medIron = gGeoManager->GetMedium("iron");  // Box
-  if (!medIron) Fatal("ConstructModule", "Medium iron not found");
-  TGeoMedium* medLead = gGeoManager->GetMedium("lead");  // Lead layers
-  if (!medLead) Fatal("ConstructModule", "Medium lead not found");
-  TGeoMedium* medTyvek = gGeoManager->GetMedium("PsdTyvek");  // Tyvek layers
-  if (!medTyvek) Fatal("ConstructModule", "Medium PsdTyvek not found");
-  TGeoMedium* medScint = gGeoManager->GetMedium("PsdScint");  // Scintillator
-  if (!medScint) Fatal("ConstructModule", "Medium PsdScint not found");
-  TGeoMedium* medFibre = gGeoManager->GetMedium("PsdFibre");  // Fibres
-  if (!medFibre) Fatal("ConstructModule", "Medium PsdFibre not found");
-  // ------------------------------------------------------------------------
-
-
-  // -----   Create module volume   -----------------------------------------
-  // Module length: nLayers of scintillators, nLayers - 1 of lead
-  // plus the iron box front and back.
-  // Material is iron.
-  Double_t moduleLength = 2. * boxDz + nLayers * (scintD + 2. * tyvekD) + (nLayers - 1) * leadD;
-  TGeoVolume* module    = gGeoManager->MakeBox(name, medIron, 0.5 * sizeXY, 0.5 * sizeXY, 0.5 * moduleLength);
-  module->SetLineColor(kRed);
-  module->Print();
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Lead filler   --------------------------------------------------
-  // The lead filler represents all lead absorber layers.
-  // The Tyvek/scintillator layers and the fibre channel will be placed
-  // inside.
-  // Dimensions are half-lengths.
-  Double_t leadLx  = 0.5 * sizeXY - boxDx;
-  Double_t leadLy  = 0.5 * sizeXY - boxDy;
-  Double_t leadLz  = 0.5 * moduleLength - boxDz;
-  TGeoVolume* lead = gGeoManager->MakeBox("lead", medLead, leadLx, leadLy, leadLz);
-  lead->SetLineColor(kBlue);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Fibre channel   ------------------------------------------------
-  // This volume represents the air gap at the top of the volume hosting the
-  // light guide fibres. The material is the same as for the scintillators
-  // (but inactive).
-  // The (half-)width of the channel is defined by the distances from the
-  // lead edges.
-  Double_t chanLx = leadLx - 0.5 * chanDistL - 0.5 * chanDistR;
-  if (chanLx < 0.) {
-    cout << "Error: lead volume is not large enough to host fibre channel!" << endl;
-    cout << "Lead width: " << 2. * leadLx << ", distance from left edge " << chanDistL << ", distance from right edge "
-         << chanDistR << endl;
-    return 0;
-  }
-  Double_t chanLy     = 0.5 * chanDy;
-  Double_t chanLz     = leadLz;
-  TGeoVolume* channel = gGeoManager->MakeBox("channel", medFibre, chanLx, chanLy, chanLz);
-  channel->SetLineColor(kMagenta);
-  // ------------------------------------------------------------------------
-
-
-  // ----   Positioning of the fibre channel   ------------------------------
-  // The channel extends from chanDistL from the left edge of the lead filler
-  // to chanDistR from its right edge (seen from the front). It is top-aligned
-  // with the lead filler.
-  Double_t chanShiftX = 0.5 * (chanDistL - chanDistR);
-  Double_t chanShiftY = leadLy - 0.5 * chanDy;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Tyvek layer   --------------------------------------------------
-  // The scintillator will be placed inside this, leaving only the thin
-  // Tyvek as a wrapper. Since these layers will be placed in the lead filler,
-  // there has to be a cut-out for the fibre channel.
-  Double_t tyvekLz        = 0.5 * scintD + tyvekD;  // half-length
-  TGeoBBox* tyv1          = new TGeoBBox("psdTyv1", leadLx, leadLy, tyvekLz);
-  TGeoBBox* tyv2          = new TGeoBBox("psdTyv2", chanLx, chanLy, tyvekLz);
-  TGeoTranslation* trans1 = new TGeoTranslation("tPsd1", chanShiftX, chanShiftY, 0.);
-  trans1->RegisterYourself();
-  TGeoCompositeShape* tyvekShape = new TGeoCompositeShape("psdTyv1-psdTyv2:tPsd1");
-  TGeoVolume* tyvek              = new TGeoVolume("tyvek", tyvekShape, medTyvek);
-  tyvek->SetLineColor(kGreen);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Scintillator layer   -------------------------------------------
-  // The scintillator layer is embedded (as daughter) into the Tyvek layer.
-  // It is also a box minus the cut-out for the fibres. The cut-out is
-  // slightly smaller than for the Tyvek volume.
-  Double_t scintLx        = leadLx - tyvekD;
-  Double_t scintLy        = leadLy - tyvekD;
-  Double_t scintLz        = 0.5 * scintD;
-  TGeoBBox* sci1          = new TGeoBBox("sci1", scintLx, scintLy, scintLz);
-  Double_t cutLx          = chanLx;
-  Double_t cutLy          = chanLy - tyvekD;
-  Double_t cutLz          = scintLz;
-  TGeoBBox* sci2          = new TGeoBBox("sci2", cutLx, cutLy, cutLz);
-  Double_t cutShiftX      = chanShiftX;
-  Double_t cutShiftY      = scintLy - cutLy;
-  TGeoTranslation* trans2 = new TGeoTranslation("tPsd2", cutShiftX, cutShiftY, 0.);
-  trans2->RegisterYourself();
-  TGeoCompositeShape* scintShape = new TGeoCompositeShape("scintShape", "sci1-sci2:tPsd2");
-  TGeoVolume* scint              = new TGeoVolume("scint", scintShape, medScint);
-  scint->SetLineColor(kBlack);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Place volumes   ------------------------------------------------
-
-  // ---> Scintillator into Tyvek
-  tyvek->AddNode(scint, 0);
-
-  // ---> Fibre channel into lead filler
-  lead->AddNode(channel, 0, trans1);
-
-  // --->  Tyvek layers into lead
-  Double_t zFirst = 0.;
-  Double_t zLast  = 0.;
-  for (Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
-    Double_t zPos = -1. * leadLz + iLayer * leadD + (2. * iLayer + 1.) * tyvekLz;
-    if (iLayer == 0) zFirst = zPos;
-    if (iLayer == nLayers - 1) zLast = zPos;
-    lead->AddNode(tyvek, iLayer, new TGeoTranslation(0., 0., zPos));
-  }
-  cout << module->GetName() << ": Positioned " << nLayers << " Tyvek layers; first at z = " << zFirst
-       << ", last at z = " << zLast << endl;
-
-  // ---> Lead into module
-  module->AddNode(lead, 0);
-  // ------------------------------------------------------------------------
-
-  return module;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/psd/create_psdgeo_v20a.C b/macro/mcbm/geometry/psd/create_psdgeo_v20a.C
deleted file mode 100644
index f305bc2319..0000000000
--- a/macro/mcbm/geometry/psd/create_psdgeo_v20a.C
+++ /dev/null
@@ -1,473 +0,0 @@
-/* Copyright (C) 2017-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/** @file create_psdgeo_v20a.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @date 16 September 2017
- ** @version 1.0
- **
- ** This macro creates a PSD geometry in ROOT format to be used as input
- ** for the transport simulation. It allows to create module stacks of
- ** varying sizes; the numbers of rows and columns must both be uneven.
- ** The centre module as well as the edge modules are omitted.
- ** The module definition is implemented in the function ConstructModule.
- **
- ** The user can adjust the steering variables to the specific needs.
- **
- ** 2020-05-26 - DE - v20a - move PSD upstream by 40 cm to z = 120 cm, relative to v18d
- ** 2018-05-24 - DE - v18d - move PSD from 20 to 25 degrees
- ** 2017-12-05 - DE - v18c - place single module very close beneath the beampipe
- ** 2017-12-02 - DE - v18a - adapted mPSD, single module to mCBM setup
- **
- **/
-
-
-using std::cout;
-using std::endl;
-using std::fstream;
-using std::right;
-using std::setw;
-
-// Forward declarations
-TGeoVolume* ConstructModule(const char* name, Double_t moduleSize, Int_t nLayers, fstream* info = 0);
-
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_psdgeo_v20a()
-{
-
-  // -----   Steering variables   ---------------------------------------------
-  const char* geoTag = "v20a_mcbm";  // geometry tag
-
-  Double_t psdX = 0.;    // x position is automatically determined from psdRotY
-  Double_t psdY = -22.;  // y position of PSD in cave
-  Double_t psdZ = 120.;  // z position of PSD in cave (front side)
-  //  Double_t psdZ       =  160.;  // z position of PSD in cave (front side)
-  Double_t psdRotX    = 0.;   // Rotation of PSD around x axis [degrees]
-  Double_t psdRotY    = 25.;  // Rotation of PSD around y axis [degrees]
-  Double_t moduleSize = 20.;  // Module size [cm]
-  Int_t nModulesX     = 1;    // Number of modules in a row (x direction)
-  Int_t nModulesY     = 1;    // Number of modules in a row (x direction)
-  // --------------------------------------------------------------------------
-
-
-  // ---- Number of modules per row/column must be uneven ---------------------
-  // Otherwise, the central one (to be skipped) is not defined.
-  if (nModulesX % 2 != 1 || nModulesY % 2 != 1) {
-    cout << "Error: number of modules per row and column must be uneven! " << nModulesX << " " << nModulesY << endl;
-    return;
-  }
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = "psd_";
-  infoFileName         = infoFileName + geoTag + ".geo.info";
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "PSD geometry " << geoTag << " created with create_psdgeo.C" << endl << endl;
-  infoFile << "Number of modules: " << nModulesX << " x " << nModulesY << endl;
-  infoFile << "Module size: " << moduleSize << " cm x " << moduleSize << " cm" << endl;
-  infoFile << "PSD translation in cave: (" << psdX << ", " << psdY << ", " << psdZ << ") cm" << endl;
-  infoFile << "PSD rotation around y axis: " << psdRotY << " degrees" << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  cout << endl << "==> Reading media..." << endl;
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  // --------------------------------------------------------------------------
-
-
-  // ------   Create the required media from the media file    ----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> Air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoManager->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-  cout << "Created medium: air" << endl;
-
-  // ---> Iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoManager->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: iron" << endl;
-
-  // ---> Lead
-  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  if (!mIron) Fatal("Main", "FairMedium lead not found");
-  geoBuild->createMedium(mLead);
-  TGeoMedium* lead = gGeoManager->GetMedium("lead");
-  if (!lead) Fatal("Main", "Medium iron not found");
-  cout << "Created medium: lead" << endl;
-
-  // ---> Tyvek
-  FairGeoMedium* mTyvek = geoMedia->getMedium("PsdTyvek");
-  if (!mTyvek) Fatal("Main", "FairMedium PsdTyvek not found");
-  geoBuild->createMedium(mTyvek);
-  TGeoMedium* tyvek = gGeoManager->GetMedium("PsdTyvek");
-  if (!tyvek) Fatal("Main", "Medium PsdTyvek not found");
-  cout << "Created medium: PsdTyvek" << endl;
-
-  // ---> Scintillator
-  FairGeoMedium* mScint = geoMedia->getMedium("PsdScint");
-  if (!mScint) Fatal("Main", "FairMedium PsdScint not found");
-  geoBuild->createMedium(mScint);
-  TGeoMedium* scint = gGeoManager->GetMedium("PsdScint");
-  if (!scint) Fatal("Main", "Medium PsdScint not found");
-  cout << "Created medium: PsdScint" << endl;
-
-  // ---> Fibres
-  FairGeoMedium* mFibre = geoMedia->getMedium("PsdFibre");
-  if (!mFibre) Fatal("Main", "FairMedium PsdFibre not found");
-  geoBuild->createMedium(mFibre);
-  TGeoMedium* fibre = gGeoManager->GetMedium("PsdFibre");
-  if (!fibre) Fatal("Main", "Medium PsdFibre not found");
-  cout << "Created medium: PsdFibre" << endl;
-
-  // ---> Medium for PSD volume
-  TGeoMedium* psdMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  cout << endl << "==> Set top volume..." << endl;
-  gGeoManager->SetName("PSDgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoManager->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create the PSD modules   -----------------------------------------
-  cout << endl;
-  TGeoVolume* module2060 = ConstructModule("module2060", 20., 60, &infoFile);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create PSD volume   ------------------------------------
-  cout << endl;
-  cout << "===> Creating PSD...." << endl;
-
-  // --- Determine size of PSD box (half-lengths)
-  Double_t psdSizeX = 0.5 * nModulesX * moduleSize;
-  Double_t psdSizeY = 0.5 * nModulesY * moduleSize;
-  TGeoBBox* shape   = dynamic_cast<TGeoBBox*>(module2060->GetShape());
-  Double_t psdSizeZ = shape->GetDZ();
-
-  TString psdName = "psd_";
-  psdName += geoTag;
-  TGeoVolume* psd = gGeoManager->MakeBox(psdName, psdMedium, psdSizeX, psdSizeY, psdSizeZ);
-  cout << "Module array is " << nModulesX << " x " << nModulesY << endl;
-  cout << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm" << endl;
-  infoFile << endl
-           << "PSD size is " << 2. * psdSizeX << " cm x " << 2. * psdSizeY << " cm x " << 2. * psdSizeZ << " cm"
-           << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place modules into the system volume   ---------------------------
-  Double_t xModCurrent = -0.5 * (nModulesX + 1) * moduleSize;
-
-  Int_t nModules = 0;
-  for (Int_t iModX = 0; iModX < nModulesX; iModX++) {
-    xModCurrent += moduleSize;
-    Double_t yModCurrent = -0.5 * (nModulesY + 1) * moduleSize;
-    for (Int_t iModY = 0; iModY < nModulesY; iModY++) {
-      yModCurrent += moduleSize;
-
-      //      // Skip edge modules
-      //      if ( ( iModX == 0 || iModX == nModulesX - 1 ) &&
-      //           ( iModY == 0 || iModY == nModulesY - 1 ) ) continue;
-      //
-      //      // Skip centre module (only for uneven number of modules)
-      //      if ( iModX == (nModulesX - 1) / 2 && iModY == (nModulesY - 1) / 2 )
-      //        continue;
-
-      // Node number and name (convention)
-      Int_t iNode = 100 * iModX + iModY;
-
-      // Position of module inside PSD
-      TGeoTranslation* trans = new TGeoTranslation(xModCurrent, yModCurrent, 0.);
-
-      psd->AddNode(module2060, iNode, trans);
-      cout << "Adding module " << setw(5) << right << iNode << " at x = " << setw(6) << right << xModCurrent
-           << " cm , y = " << setw(6) << right << yModCurrent << " cm" << endl;
-      nModules++;
-
-    }  //# modules in y direction
-  }    //# modules in x direction
-  cout << "PSD contains " << nModules << " modules." << endl;
-  infoFile << "PSD contains " << nModules << " modules." << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -----   Place PSD in top node (cave) -------------------------------------
-  TGeoRotation* psdRot = new TGeoRotation();
-  //  psdRot->RotateY(psdRotY);
-
-  // DEDE start
-  psdZ = psdZ + psdSizeZ;
-
-  // calculate mPSD x-position
-  psdX = psdZ * tan(psdRotY * acos(-1) / 180);
-  cout << "psdX at " << psdRotY << " degree angle: x= " << psdX << " cm" << endl;
-
-  // rotate around x axis
-  psdRotX = atan(psdY / sqrt(psdX * psdX + psdZ * psdZ)) * 180 / acos(-1);
-  psdRot->RotateX(-psdRotX);
-
-  cout << "angle around x: " << psdRotX << " deg" << endl;
-  cout << "y " << psdY << " t " << sqrt(psdX * psdX + psdZ * psdZ) << " cm" << endl;
-
-  // rotate around y axis
-  //  psdRotY = atan( psdX / psdZ ) * 180 / acos(-1);  // psdX is already calculated accordingly
-  psdRot->RotateY(psdRotY);
-
-  cout << "angle around y: " << psdRotY << " deg" << endl;
-  cout << "x " << psdX << " y " << psdY << " cm" << endl;
-
-  cout << endl;
-  // DEDE stop
-
-  //  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ + psdSizeZ, psdRot);
-  TGeoCombiTrans* psdTrans = new TGeoCombiTrans(psdX, psdY, psdZ, psdRot);
-  top->AddNode(psd, 0, psdTrans);
-  cout << endl << "==> PSD position in cave: " << endl;
-  psdTrans->Print();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Close and check geometry   ---------------------------------------
-  cout << endl << "==> Closing geometry..." << endl;
-  gGeoManager->CloseGeometry();
-  gGeoManager->CheckGeometryFull();
-  cout << endl;
-  gGeoManager->CheckOverlaps(0.0001, "s");
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write PSD volume and placement matrix to geometry file   ---------
-  cout << endl;
-  TString geoFileName = "psd_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  psd->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  psdTrans->Write();
-  cout << endl;
-  cout << "==> Geometry " << psd->GetName() << " written to " << geoFileName << endl;
-  cout << "==> Info written to " << infoFileName << endl;
-  geoFile->Close();
-  infoFile.close();
-  // --------------------------------------------------------------------------
-
-
-  // -----   Write entire TGeoManager to file   -------------------------------
-  TString geoManFileName = "psd_";
-  geoManFileName         = geoManFileName + geoTag + ".geoman.root";
-  TFile* geoManFile      = new TFile(geoManFileName, "RECREATE");
-  gGeoManager->Write();
-  geoManFile->Close();
-  cout << "==> TGeoManager " << gGeoManager->GetName() << " written to " << geoManFileName << endl << endl << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ----   Display geometry   ------------------------------------------------
-  gGeoManager->SetVisLevel(5);  // Scintillator level
-  top->Draw("ogl");
-  // --------------------------------------------------------------------------
-}
-//  End of main function
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructModule(const char* name, Double_t sizeXY, Int_t nLayers, fstream* info)
-{
-
-  // The module consists of nLayers of scintillators covered with Tyvek.
-  // Between each two scintillators, there is a lead layer (total nLayers -1).
-  // At the top, there is a gap to stretch the light fibres. This is modelled
-  // by a volume made of the same material as the scintillator (but inactive).
-  // The arrangement is surrounded by iron. At the front and at the back,
-  // there is a thick iron layer (the back one acting as first absorber)
-  // for constructional reasons.
-
-  cout << "===> Creating Module " << name << ", size " << sizeXY << " cm with " << nLayers << " layers...." << endl;
-
-  // -----   Constructional parameters   ----------------------------
-  Double_t leadD     = 1.60;  // Thickness of lead layer
-  Double_t scintD    = 0.40;  // Thickness of scintillator layer
-  Double_t tyvekD    = 0.02;  // Thickness of Tyvek wrapper around scintillator
-  Double_t boxDx     = 0.15;  // Thickness of iron box lateral
-  Double_t boxDy     = 0.05;  // Thickness of iron box top/bottom
-  Double_t boxDz     = 2.00;  // Thickness of iron box front/back
-  Double_t chanDy    = 0.20;  // Height of fibre channel
-  Double_t chanDistL = 0.50;  // Distance of channel from left edge of lead
-  Double_t chanDistR = 2.00;  // Distance of channel from right edge of lead
-  // ------------------------------------------------------------------------
-
-
-  // -----   Info to file   -------------------------------------------------
-  if (info) {
-    (*info) << "Parameters of module " << name << ": " << endl;
-    (*info) << "Size: " << sizeXY << " cm x " << sizeXY << " cm" << endl;
-    (*info) << "Number of layers: " << nLayers << endl;
-    (*info) << "Thickness of lead layers: " << leadD << " cm" << endl;
-    (*info) << "Thickness of scintillators: " << scintD << " cm" << endl;
-    (*info) << "Thickness of Tyvek wrap: " << tyvekD << " cm" << endl;
-    (*info) << "Thickness of iron box: (" << boxDx << " / " << boxDy << " / " << boxDz << ") cm" << endl;
-    (*info) << "Height of fibre channel: " << chanDy << " cm" << endl;
-    (*info) << "Distance of channel from edges: left " << chanDistL << " cm, right " << chanDistR << " cm" << endl;
-  }
-  // ------------------------------------------------------------------------
-
-
-  // -----   Get required media   -------------------------------------------
-  TGeoMedium* medAir = gGeoManager->GetMedium("air");  // PSD
-  if (!medAir) Fatal("ConstructModule", "Medium air not found");
-  TGeoMedium* medIron = gGeoManager->GetMedium("iron");  // Box
-  if (!medIron) Fatal("ConstructModule", "Medium iron not found");
-  TGeoMedium* medLead = gGeoManager->GetMedium("lead");  // Lead layers
-  if (!medLead) Fatal("ConstructModule", "Medium lead not found");
-  TGeoMedium* medTyvek = gGeoManager->GetMedium("PsdTyvek");  // Tyvek layers
-  if (!medTyvek) Fatal("ConstructModule", "Medium PsdTyvek not found");
-  TGeoMedium* medScint = gGeoManager->GetMedium("PsdScint");  // Scintillator
-  if (!medScint) Fatal("ConstructModule", "Medium PsdScint not found");
-  TGeoMedium* medFibre = gGeoManager->GetMedium("PsdFibre");  // Fibres
-  if (!medFibre) Fatal("ConstructModule", "Medium PsdFibre not found");
-  // ------------------------------------------------------------------------
-
-
-  // -----   Create module volume   -----------------------------------------
-  // Module length: nLayers of scintillators, nLayers - 1 of lead
-  // plus the iron box front and back.
-  // Material is iron.
-  Double_t moduleLength = 2. * boxDz + nLayers * (scintD + 2. * tyvekD) + (nLayers - 1) * leadD;
-  TGeoVolume* module    = gGeoManager->MakeBox(name, medIron, 0.5 * sizeXY, 0.5 * sizeXY, 0.5 * moduleLength);
-  module->SetLineColor(kRed);
-  module->Print();
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Lead filler   --------------------------------------------------
-  // The lead filler represents all lead absorber layers.
-  // The Tyvek/scintillator layers and the fibre channel will be placed
-  // inside.
-  // Dimensions are half-lengths.
-  Double_t leadLx  = 0.5 * sizeXY - boxDx;
-  Double_t leadLy  = 0.5 * sizeXY - boxDy;
-  Double_t leadLz  = 0.5 * moduleLength - boxDz;
-  TGeoVolume* lead = gGeoManager->MakeBox("lead", medLead, leadLx, leadLy, leadLz);
-  lead->SetLineColor(kBlue);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Fibre channel   ------------------------------------------------
-  // This volume represents the air gap at the top of the volume hosting the
-  // light guide fibres. The material is the same as for the scintillators
-  // (but inactive).
-  // The (half-)width of the channel is defined by the distances from the
-  // lead edges.
-  Double_t chanLx = leadLx - 0.5 * chanDistL - 0.5 * chanDistR;
-  if (chanLx < 0.) {
-    cout << "Error: lead volume is not large enough to host fibre channel!" << endl;
-    cout << "Lead width: " << 2. * leadLx << ", distance from left edge " << chanDistL << ", distance from right edge "
-         << chanDistR << endl;
-    return 0;
-  }
-  Double_t chanLy     = 0.5 * chanDy;
-  Double_t chanLz     = leadLz;
-  TGeoVolume* channel = gGeoManager->MakeBox("channel", medFibre, chanLx, chanLy, chanLz);
-  channel->SetLineColor(kMagenta);
-  // ------------------------------------------------------------------------
-
-
-  // ----   Positioning of the fibre channel   ------------------------------
-  // The channel extends from chanDistL from the left edge of the lead filler
-  // to chanDistR from its right edge (seen from the front). It is top-aligned
-  // with the lead filler.
-  Double_t chanShiftX = 0.5 * (chanDistL - chanDistR);
-  Double_t chanShiftY = leadLy - 0.5 * chanDy;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Tyvek layer   --------------------------------------------------
-  // The scintillator will be placed inside this, leaving only the thin
-  // Tyvek as a wrapper. Since these layers will be placed in the lead filler,
-  // there has to be a cut-out for the fibre channel.
-  Double_t tyvekLz        = 0.5 * scintD + tyvekD;  // half-length
-  TGeoBBox* tyv1          = new TGeoBBox("psdTyv1", leadLx, leadLy, tyvekLz);
-  TGeoBBox* tyv2          = new TGeoBBox("psdTyv2", chanLx, chanLy, tyvekLz);
-  TGeoTranslation* trans1 = new TGeoTranslation("tPsd1", chanShiftX, chanShiftY, 0.);
-  trans1->RegisterYourself();
-  TGeoCompositeShape* tyvekShape = new TGeoCompositeShape("psdTyv1-psdTyv2:tPsd1");
-  TGeoVolume* tyvek              = new TGeoVolume("tyvek", tyvekShape, medTyvek);
-  tyvek->SetLineColor(kGreen);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Scintillator layer   -------------------------------------------
-  // The scintillator layer is embedded (as daughter) into the Tyvek layer.
-  // It is also a box minus the cut-out for the fibres. The cut-out is
-  // slightly smaller than for the Tyvek volume.
-  Double_t scintLx        = leadLx - tyvekD;
-  Double_t scintLy        = leadLy - tyvekD;
-  Double_t scintLz        = 0.5 * scintD;
-  TGeoBBox* sci1          = new TGeoBBox("sci1", scintLx, scintLy, scintLz);
-  Double_t cutLx          = chanLx;
-  Double_t cutLy          = chanLy - tyvekD;
-  Double_t cutLz          = scintLz;
-  TGeoBBox* sci2          = new TGeoBBox("sci2", cutLx, cutLy, cutLz);
-  Double_t cutShiftX      = chanShiftX;
-  Double_t cutShiftY      = scintLy - cutLy;
-  TGeoTranslation* trans2 = new TGeoTranslation("tPsd2", cutShiftX, cutShiftY, 0.);
-  trans2->RegisterYourself();
-  TGeoCompositeShape* scintShape = new TGeoCompositeShape("scintShape", "sci1-sci2:tPsd2");
-  TGeoVolume* scint              = new TGeoVolume("scint", scintShape, medScint);
-  scint->SetLineColor(kBlack);
-  // ------------------------------------------------------------------------
-
-
-  // -----   Place volumes   ------------------------------------------------
-
-  // ---> Scintillator into Tyvek
-  tyvek->AddNode(scint, 0);
-
-  // ---> Fibre channel into lead filler
-  lead->AddNode(channel, 0, trans1);
-
-  // --->  Tyvek layers into lead
-  Double_t zFirst = 0.;
-  Double_t zLast  = 0.;
-  for (Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
-    Double_t zPos = -1. * leadLz + iLayer * leadD + (2. * iLayer + 1.) * tyvekLz;
-    if (iLayer == 0) zFirst = zPos;
-    if (iLayer == nLayers - 1) zLast = zPos;
-    lead->AddNode(tyvek, iLayer, new TGeoTranslation(0., 0., zPos));
-  }
-  cout << module->GetName() << ": Positioned " << nLayers << " Tyvek layers; first at z = " << zFirst
-       << ", last at z = " << zLast << endl;
-
-  // ---> Lead into module
-  module->AddNode(lead, 0);
-  // ------------------------------------------------------------------------
-
-  return module;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/rich/create_rich_v18a_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18a_mcbm.C
deleted file mode 100644
index 6f4c354a62..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18a_mcbm.C
+++ /dev/null
@@ -1,282 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include <iostream>
-using namespace std;
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate
-};
-
-void create_rich_v18a_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  RichGeomType richGeomType = kGlassLense;
-
-  TString geoFileName = "rich_v18a_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuartz = geoMedia->getMedium("Rich_quartz");
-  FairGeoMedium* mQuartz = geoMedia->getMedium("air");  // there is no Rich_quartz in media.geo
-  if (mQuartz == NULL) Fatal("Main", "FairMedium Rich_quartz not found");
-  geoBuild->createMedium(mQuartz);
-  //	TGeoMedium* medQuartz = gGeoMan->GetMedium("Rich_quartz");
-  TGeoMedium* medQuartz = gGeoMan->GetMedium("air");  // there is no Rich_quartz in media.geo
-  if (medQuartz == NULL) Fatal("Main", "Medium Rich_quartz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 20;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 1.0;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quartz plate
-  const Double_t quartzThickness   = 0.3;
-  const Double_t quartzWidth       = 5.;
-  const Double_t quartzHeight      = 5.;
-  const Double_t quartzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  //	TGeoTranslation *trCave= new TGeoTranslation(0., 0., 0.);
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-  Double_t xPos = -48.;
-  Double_t yPos = 0.;
-  Double_t zPos = 280.;
-
-  Double_t proto_angle = atan(xPos / zPos) * 180 / acos(-1);
-
-  TGeoRotation* proto_rotation = new TGeoRotation();
-  proto_rotation->RotateY(proto_angle);
-  TGeoCombiTrans* trCave = new TGeoCombiTrans(xPos, yPos, zPos, proto_rotation);
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else {
-    pmtPlaneZ = quartzPmtDistance + quartzThickness / 2. + pmtThickness / 2.;
-  }
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuartzPlate(0., 0., 0.);
-  TGeoRotation rotQuartzPlate;
-  rotQuartzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuartzPlate = new TGeoCombiTrans(trQuartzPlate, rotQuartzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  //Virtual Topbox
-  TGeoVolume* topVol = new TGeoVolumeAssembly("rich");
-  gGeoMan->SetTopVolume(topVol);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol    = gGeoMan->MakeBox("rich_v18a_mcbm", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol     = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol     = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-  TGeoVolume* pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI, 3 * pmtSizeHalf + pmtGap,
-                                            2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtVol     = gGeoMan->MakeBox("Pmt", medCsI, pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* quartzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuartz, quartzWidth / 2., quartzHeight / 2., quartzThickness / 2.);
-
-  //Positioning
-  topVol->AddNode(caveVol, 1, trCave);
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else {
-    gasVol->AddNode(quartzVol, 1, combiTrQuartzPlate);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  topVol->Draw("ogl");
-  gGeoMan->SetVisLevel(5);
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  topVol->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18b_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18b_mcbm.C
deleted file mode 100644
index e9a58d8860..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18b_mcbm.C
+++ /dev/null
@@ -1,321 +0,0 @@
-/* Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate
-};
-
-void create_rich_v18b_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  RichGeomType richGeomType = kGlassLense;
-
-  TString geoFileName = "rich_v18b_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuartz = geoMedia->getMedium("Rich_quartz");
-  FairGeoMedium* mQuartz = geoMedia->getMedium("air");  // there is no Rich_quartz in media.geo
-  if (mQuartz == NULL) Fatal("Main", "FairMedium Rich_quartz not found");
-  geoBuild->createMedium(mQuartz);
-  //	TGeoMedium* medQuartz = gGeoMan->GetMedium("Rich_quartz");
-  TGeoMedium* medQuartz = gGeoMan->GetMedium("air");  // there is no Rich_quartz in media.geo
-  if (medQuartz == NULL) Fatal("Main", "Medium Rich_quartz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 20;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 1.0;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quartz plate
-  const Double_t quartzThickness   = 0.3;
-  const Double_t quartzWidth       = 5.;
-  const Double_t quartzHeight      = 5.;
-  const Double_t quartzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  Double_t xPos[4] = {-48, -18, -48, -18};  // {-20,  20, -20,  20};
-  Double_t yPos[4] = {-24, -24, 24, 24};    // {-20, -20,  20,  20};
-  Double_t zPos[4] = {280, 280, 280, 280};  // { 50,  50,  50,  50};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < 4; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else {
-    pmtPlaneZ = quartzPmtDistance + quartzThickness / 2. + pmtThickness / 2.;
-  }
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuartzPlate(0., 0., 0.);
-  TGeoRotation rotQuartzPlate;
-  rotQuartzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuartzPlate = new TGeoCombiTrans(trQuartzPlate, rotQuartzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18b_mcbm");
-  top->AddNode(rich, 1);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol    = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol     = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol     = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-  TGeoVolume* pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI, 3 * pmtSizeHalf + pmtGap,
-                                            2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtVol     = gGeoMan->MakeBox("Pmt", medCsI, pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* quartzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuartz, quartzWidth / 2., quartzHeight / 2., quartzThickness / 2.);
-
-  //Positioning
-  rich->AddNode(caveVol, 1, trCave[0]);
-  rich->AddNode(caveVol, 2, trCave[1]);
-  rich->AddNode(caveVol, 3, trCave[2]);
-  rich->AddNode(caveVol, 4, trCave[3]);
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else {
-    gasVol->AddNode(quartzVol, 1, combiTrQuartzPlate);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18c_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18c_mcbm.C
deleted file mode 100644
index d1981c90ea..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18c_mcbm.C
+++ /dev/null
@@ -1,322 +0,0 @@
-/* Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate
-};
-
-void create_rich_v18c_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  RichGeomType richGeomType = kGlassLense;
-
-  TString geoFileName = "rich_v18c_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuartz = geoMedia->getMedium("Rich_quartz");
-  FairGeoMedium* mQuartz = geoMedia->getMedium("air");  // there is no Rich_quartz in media.geo
-  if (mQuartz == NULL) Fatal("Main", "FairMedium Rich_quartz not found");
-  geoBuild->createMedium(mQuartz);
-  //	TGeoMedium* medQuartz = gGeoMan->GetMedium("Rich_quartz");
-  TGeoMedium* medQuartz = gGeoMan->GetMedium("air");  // there is no Rich_quartz in media.geo
-  if (medQuartz == NULL) Fatal("Main", "Medium Rich_quartz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 20;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 1.0;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quartz plate
-  const Double_t quartzThickness   = 0.3;
-  const Double_t quartzWidth       = 5.;
-  const Double_t quartzHeight      = 5.;
-  const Double_t quartzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  Double_t xPos[4] = {-48, -18, -48, -18};  // {-20,  20, -20,  20};
-  Double_t yPos[4] = {-24, -24, 24, 24};    // {-20, -20,  20,  20};
-  Double_t zPos[4] = {355, 355, 355, 355};  // { 50,  50,  50,  50};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < 4; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else {
-    pmtPlaneZ = quartzPmtDistance + quartzThickness / 2. + pmtThickness / 2.;
-  }
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuartzPlate(0., 0., 0.);
-  TGeoRotation rotQuartzPlate;
-  rotQuartzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuartzPlate = new TGeoCombiTrans(trQuartzPlate, rotQuartzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18c_mcbm");
-  top->AddNode(rich, 1);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol    = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol     = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol     = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-  TGeoVolume* pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI, 3 * pmtSizeHalf + pmtGap,
-                                            2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtVol     = gGeoMan->MakeBox("Pmt", medCsI, pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* quartzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuartz, quartzWidth / 2., quartzHeight / 2., quartzThickness / 2.);
-
-  //Positioning
-  rich->AddNode(caveVol, 1, trCave[0]);
-  rich->AddNode(caveVol, 2, trCave[1]);
-  rich->AddNode(caveVol, 3, trCave[2]);
-  rich->AddNode(caveVol, 4, trCave[3]);
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else {
-    gasVol->AddNode(quartzVol, 1, combiTrQuartzPlate);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18d_gp_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18d_gp_mcbm.C
deleted file mode 100644
index 7fe4821fc1..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18d_gp_mcbm.C
+++ /dev/null
@@ -1,351 +0,0 @@
-/* Copyright (C) 2017-2018 Justus-Liebig-Universitaet Giessen, Giessen
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Gregor Pitsch [committer] */
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate,
-  kAerogel
-};
-
-void create_rich_v18d_gp_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  RichGeomType richGeomType = kAerogel;
-
-  TString geoFileName = "rich_v18d_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  //	TString geoPath = gSystem->Getenv("VMCWORKDIR");
-  //	TString medFile = geoPath + "/geometry/media.geo";
-  TString medFile = "/home/aghoehne/Documents/CbmRoot/trunkNew/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuarz = geoMedia->getMedium("Rich_Quarz");
-  /*	FairGeoMedium* mQuarz = geoMedia->getMedium("air");   // there is no Rich_Quarz in media.geo
-	if (mQuarz == NULL) Fatal("Main", "FairMedium Rich_Quarz not found");
-	geoBuild->createMedium(mQuarz);
-	//	TGeoMedium* medQuarz = gGeoMan->GetMedium("Rich_Quarz");
-	TGeoMedium* medQuarz = gGeoMan->GetMedium("air");   // there is no Rich_Quarz in media.geo
-	if (medQuarz == NULL) Fatal("Main", "Medium Rich_Quarz  not found");
-*/
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 25;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 0.3;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quarz plate
-  const Double_t QuarzThickness   = 0.3;
-  const Double_t QuarzWidth       = 5.;
-  const Double_t QuarzHeight      = 5.;
-  const Double_t QuarzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Aerogel Box
-  const Double_t aerogelLength      = 2.;
-  const Double_t aerogelWidth       = 20.;
-  const Double_t aerogelHeight      = 20.;
-  const Double_t aerogelPmtDistance = 10.;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  Double_t xPos[4] = {-48, -18, -48, -18};  // {-20,  20, -20,  20};
-  Double_t yPos[4] = {-24, -24, 24, 24};    // {-20, -20,  20,  20};
-  Double_t zPos[4] = {355, 355, 355, 355};  // { 50,  50,  50,  50};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < 4; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else if (richGeomType == kQuarzPlate) {
-    pmtPlaneZ = QuarzPmtDistance + QuarzThickness / 2. + pmtThickness / 2.;
-  }
-  else {
-    pmtPlaneZ = aerogelPmtDistance + aerogelLength / 2. + pmtThickness / 2.;
-  }
-
-
-  TGeoTranslation* trAerogel = new TGeoTranslation(0., 0., 0.);
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuarzPlate(0., 0., 0.);
-  TGeoRotation rotQuarzPlate;
-  rotQuarzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuarzPlate = new TGeoCombiTrans(trQuarzPlate, rotQuarzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18d_mcbm");
-  top->AddNode(rich, 1);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol    = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol     = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol     = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-  TGeoVolume* pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI, 3 * pmtSizeHalf + pmtGap,
-                                            2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtVol     = gGeoMan->MakeBox("Pmt", medCsI, pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  //	TGeoVolume *QuarzVol = gGeoMan->MakeBox("QuarzPlate", medQuarz , QuarzWidth / 2., QuarzHeight / 2., QuarzThickness / 2.);
-
-  //Aerogel box
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("AerogelBox", medAerogel, aerogelWidth / 2., aerogelHeight / 2., aerogelLength / 2.);
-
-  //Positioning
-  rich->AddNode(caveVol, 1, trCave[0]);
-  rich->AddNode(caveVol, 2, trCave[1]);
-  rich->AddNode(caveVol, 3, trCave[2]);
-  rich->AddNode(caveVol, 4, trCave[3]);
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else if (richGeomType == kQuarzPlate) {
-    //		gasVol->AddNode(QuarzVol, 1, combiTrQuarzPlate);
-  }
-  else {
-    gasVol->AddNode(aerogelVol, 1, trAerogel);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18d_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18d_mcbm.C
deleted file mode 100644
index ddacf67f38..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18d_mcbm.C
+++ /dev/null
@@ -1,374 +0,0 @@
-/* Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoSphere.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate,
-  kAerogel
-};
-
-void create_rich_v18d_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  TGeoManager* gGeoMan = NULL;  // Pointer to TGeoManager instance
-
-  RichGeomType richGeomType = kAerogel;
-
-  TString geoFileName = "rich_v18d_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuarz = geoMedia->getMedium("Rich_Quarz");
-  FairGeoMedium* mQuarz = geoMedia->getMedium("air");  // there is no Rich_Quarz in media.geo
-  if (mQuarz == NULL) Fatal("Main", "FairMedium Rich_Quarz not found");
-  geoBuild->createMedium(mQuarz);
-  //	TGeoMedium* medQuarz = gGeoMan->GetMedium("Rich_Quarz");
-  TGeoMedium* medQuarz = gGeoMan->GetMedium("air");  // there is no Rich_Quarz in media.geo
-  if (medQuarz == NULL) Fatal("Main", "Medium Rich_Quarz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 25;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 0.3;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quarz plate
-  const Double_t QuarzThickness   = 0.3;
-  const Double_t QuarzWidth       = 5.;
-  const Double_t QuarzHeight      = 5.;
-  const Double_t QuarzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Aerogel Box
-  const Double_t aerogelLength      = 2.;
-  const Double_t aerogelWidth       = 20.;
-  const Double_t aerogelHeight      = 20.;
-  const Double_t aerogelPmtDistance = 10.;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  Int_t i;
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  Double_t xPos[4] = {-48, -18, -48, -18};  // {-20,  20, -20,  20};
-  Double_t yPos[4] = {-24, -24, 24, 24};    // {-20, -20,  20,  20};
-  Double_t zPos[4] = {355, 355, 355, 355};  // { 50,  50,  50,  50};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < 4; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else if (richGeomType == kQuarzPlate) {
-    pmtPlaneZ = QuarzPmtDistance + QuarzThickness / 2. + pmtThickness / 2.;
-  }
-  else {
-    pmtPlaneZ = aerogelPmtDistance + aerogelLength / 2. + pmtThickness / 2.;
-  }
-
-
-  TGeoTranslation* trAerogel = new TGeoTranslation(0., 0., 0.);
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuarzPlate(0., 0., 0.);
-  TGeoRotation rotQuarzPlate;
-  rotQuarzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuarzPlate = new TGeoCombiTrans(trQuarzPlate, rotQuarzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18d_mcbm");
-  top->AddNode(rich, 1);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol    = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol     = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol     = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-  TGeoVolume* pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI, 3 * pmtSizeHalf + pmtGap,
-                                            2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtVol     = gGeoMan->MakeBox("Pmt", medCsI, pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* QuarzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuarz, QuarzWidth / 2., QuarzHeight / 2., QuarzThickness / 2.);
-
-  //Aerogel box
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("AerogelBox", medAerogel, aerogelWidth / 2., aerogelHeight / 2., aerogelLength / 2.);
-
-  //Positioning
-  rich->AddNode(caveVol, 1, trCave[0]);
-  rich->AddNode(caveVol, 2, trCave[1]);
-  rich->AddNode(caveVol, 3, trCave[2]);
-  rich->AddNode(caveVol, 4, trCave[3]);
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else if (richGeomType == kQuarzPlate) {
-    gasVol->AddNode(QuarzVol, 1, combiTrQuarzPlate);
-  }
-  else {
-    gasVol->AddNode(aerogelVol, 1, trAerogel);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18e_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18e_mcbm.C
deleted file mode 100644
index 9d94fd8609..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18e_mcbm.C
+++ /dev/null
@@ -1,380 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoSphere.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2018-01-18 - v18e - DE - use volume assembly instead of boxes for PMT_containder and PMT
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate,
-  kAerogel
-};
-
-void create_rich_v18e_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  TGeoManager* gGeoMan = NULL;  // Pointer to TGeoManager instance
-
-  RichGeomType richGeomType = kAerogel;
-
-  TString geoFileName = "rich_v18e_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuarz = geoMedia->getMedium("Rich_Quarz");
-  FairGeoMedium* mQuarz = geoMedia->getMedium("air");  // there is no Rich_Quarz in media.geo
-  if (mQuarz == NULL) Fatal("Main", "FairMedium Rich_Quarz not found");
-  geoBuild->createMedium(mQuarz);
-  //	TGeoMedium* medQuarz = gGeoMan->GetMedium("Rich_Quarz");
-  TGeoMedium* medQuarz = gGeoMan->GetMedium("air");  // there is no Rich_Quarz in media.geo
-  if (medQuarz == NULL) Fatal("Main", "Medium Rich_Quarz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 25;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 0.3;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quarz plate
-  const Double_t QuarzThickness   = 0.3;
-  const Double_t QuarzWidth       = 5.;
-  const Double_t QuarzHeight      = 5.;
-  const Double_t QuarzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Aerogel Box
-  const Double_t aerogelLength      = 2.;
-  const Double_t aerogelWidth       = 20.;
-  const Double_t aerogelHeight      = 20.;
-  const Double_t aerogelPmtDistance = 10.;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  Int_t i;
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  Double_t xPos[4] = {-48, -18, -48, -18};  // {-20,  20, -20,  20};
-  Double_t yPos[4] = {-24, -24, 24, 24};    // {-20, -20,  20,  20};
-  Double_t zPos[4] = {355, 355, 355, 355};  // { 50,  50,  50,  50};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < 4; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else if (richGeomType == kQuarzPlate) {
-    pmtPlaneZ = QuarzPmtDistance + QuarzThickness / 2. + pmtThickness / 2.;
-  }
-  else {
-    pmtPlaneZ = aerogelPmtDistance + aerogelLength / 2. + pmtThickness / 2.;
-  }
-
-
-  TGeoTranslation* trAerogel = new TGeoTranslation(0., 0., 0.);
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuarzPlate(0., 0., 0.);
-  TGeoRotation rotQuarzPlate;
-  rotQuarzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuarzPlate = new TGeoCombiTrans(trQuarzPlate, rotQuarzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18e_mcbm");
-  top->AddNode(rich, 1);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol  = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol  = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-
-  //	TGeoVolume *pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI , 3 * pmtSizeHalf + pmtGap, 2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("PmtContainer");
-
-  //	TGeoVolume *pmtVol = gGeoMan->MakeBox("Pmt", medCsI , pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtVol = new TGeoVolumeAssembly("Pmt");
-
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* QuarzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuarz, QuarzWidth / 2., QuarzHeight / 2., QuarzThickness / 2.);
-
-  //Aerogel box
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("AerogelBox", medAerogel, aerogelWidth / 2., aerogelHeight / 2., aerogelLength / 2.);
-
-  //Positioning
-  rich->AddNode(caveVol, 1, trCave[0]);
-  rich->AddNode(caveVol, 2, trCave[1]);
-  rich->AddNode(caveVol, 3, trCave[2]);
-  rich->AddNode(caveVol, 4, trCave[3]);
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else if (richGeomType == kQuarzPlate) {
-    gasVol->AddNode(QuarzVol, 1, combiTrQuarzPlate);
-  }
-  else {
-    gasVol->AddNode(aerogelVol, 1, trAerogel);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  //	pmtPixelVol->SetLineColor(kYellow+4);
-  pmtPixelVol->SetLineColor(kYellow);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18f_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18f_mcbm.C
deleted file mode 100644
index 13cd6337be..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18f_mcbm.C
+++ /dev/null
@@ -1,381 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoSphere.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2018-01-18 - v18f - DE - change medium of PMT_pixel to N2 instead of CsI
-// 2018-01-18 - v18e - DE - use volume assembly instead of boxes for PMT_containder and PMT
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate,
-  kAerogel
-};
-
-void create_rich_v18f_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  TGeoManager* gGeoMan = NULL;  // Pointer to TGeoManager instance
-
-  RichGeomType richGeomType = kAerogel;
-
-  TString geoFileName = "rich_v18f_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuarz = geoMedia->getMedium("Rich_Quarz");
-  FairGeoMedium* mQuarz = geoMedia->getMedium("air");  // there is no Rich_Quarz in media.geo
-  if (mQuarz == NULL) Fatal("Main", "FairMedium Rich_Quarz not found");
-  geoBuild->createMedium(mQuarz);
-  //	TGeoMedium* medQuarz = gGeoMan->GetMedium("Rich_Quarz");
-  TGeoMedium* medQuarz = gGeoMan->GetMedium("air");  // there is no Rich_Quarz in media.geo
-  if (medQuarz == NULL) Fatal("Main", "Medium Rich_Quarz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 25;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 0.3;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quarz plate
-  const Double_t QuarzThickness   = 0.3;
-  const Double_t QuarzWidth       = 5.;
-  const Double_t QuarzHeight      = 5.;
-  const Double_t QuarzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Aerogel Box
-  const Double_t aerogelLength      = 2.;
-  const Double_t aerogelWidth       = 20.;
-  const Double_t aerogelHeight      = 20.;
-  const Double_t aerogelPmtDistance = 10.;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  Int_t i;
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  Double_t xPos[4] = {-48, -18, -48, -18};  // {-20,  20, -20,  20};
-  Double_t yPos[4] = {-24, -24, 24, 24};    // {-20, -20,  20,  20};
-  Double_t zPos[4] = {355, 355, 355, 355};  // { 50,  50,  50,  50};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < 4; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else if (richGeomType == kQuarzPlate) {
-    pmtPlaneZ = QuarzPmtDistance + QuarzThickness / 2. + pmtThickness / 2.;
-  }
-  else {
-    pmtPlaneZ = aerogelPmtDistance + aerogelLength / 2. + pmtThickness / 2.;
-  }
-
-
-  TGeoTranslation* trAerogel = new TGeoTranslation(0., 0., 0.);
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuarzPlate(0., 0., 0.);
-  TGeoRotation rotQuarzPlate;
-  rotQuarzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuarzPlate = new TGeoCombiTrans(trQuarzPlate, rotQuarzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18f_mcbm");
-  top->AddNode(rich, 1);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol  = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol  = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-
-  //	TGeoVolume *pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI , 3 * pmtSizeHalf + pmtGap, 2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("PmtContainer");
-
-  //	TGeoVolume *pmtVol = gGeoMan->MakeBox("Pmt", medCsI , pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtVol = new TGeoVolumeAssembly("Pmt");
-
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medNitrogen, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* QuarzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuarz, QuarzWidth / 2., QuarzHeight / 2., QuarzThickness / 2.);
-
-  //Aerogel box
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("AerogelBox", medAerogel, aerogelWidth / 2., aerogelHeight / 2., aerogelLength / 2.);
-
-  //Positioning
-  rich->AddNode(caveVol, 1, trCave[0]);
-  rich->AddNode(caveVol, 2, trCave[1]);
-  rich->AddNode(caveVol, 3, trCave[2]);
-  rich->AddNode(caveVol, 4, trCave[3]);
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else if (richGeomType == kQuarzPlate) {
-    gasVol->AddNode(QuarzVol, 1, combiTrQuarzPlate);
-  }
-  else {
-    gasVol->AddNode(aerogelVol, 1, trAerogel);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  //	pmtPixelVol->SetLineColor(kYellow+4);
-  pmtPixelVol->SetLineColor(kYellow);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18g_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18g_mcbm.C
deleted file mode 100644
index c3a07a2eb8..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18g_mcbm.C
+++ /dev/null
@@ -1,384 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoSphere.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2018-11-22 - v18g - DE - based on v18d - use 6x 3x2 PMT array as planned for mRICH 2019
-// 2018-01-18 - v18f - DE - change medium of PMT_pixel to N2 instead of CsI
-// 2018-01-18 - v18e - DE - use volume assembly instead of boxes for PMT_containder and PMT
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate,
-  kAerogel
-};
-
-void create_rich_v18g_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  TGeoManager* gGeoMan = NULL;  // Pointer to TGeoManager instance
-
-  RichGeomType richGeomType = kAerogel;
-
-  TString geoFileName = "rich_v18g_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuarz = geoMedia->getMedium("Rich_Quarz");
-  FairGeoMedium* mQuarz = geoMedia->getMedium("air");  // there is no Rich_Quarz in media.geo
-  if (mQuarz == NULL) Fatal("Main", "FairMedium Rich_Quarz not found");
-  geoBuild->createMedium(mQuarz);
-  //	TGeoMedium* medQuarz = gGeoMan->GetMedium("Rich_Quarz");
-  TGeoMedium* medQuarz = gGeoMan->GetMedium("air");  // there is no Rich_Quarz in media.geo
-  if (medQuarz == NULL) Fatal("Main", "Medium Rich_Quarz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 25;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 0.3;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quarz plate
-  const Double_t QuarzThickness   = 0.3;
-  const Double_t QuarzWidth       = 5.;
-  const Double_t QuarzHeight      = 5.;
-  const Double_t QuarzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Aerogel Box
-  const Double_t aerogelLength      = 2.;
-  const Double_t aerogelWidth       = 20.;
-  const Double_t aerogelHeight      = 20.;
-  const Double_t aerogelPmtDistance = 10.;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  Int_t i;
-
-  const Int_t nmRich = 3;  // number of mRICH modules in the setup
-
-  TGeoRotation* rotBox = new TGeoRotation("rotBox", 0., 0., 0.);
-
-  //  	Double_t xPos[4] = {-48, -18, -48, -18};   // {-20,  20, -20,  20};
-  //  	Double_t yPos[4] = {-24, -24,  24,  24};   // {-20, -20,  20,  20};
-  //  	Double_t zPos[4] = {355, 355, 355, 355};   // { 50,  50,  50,  50};
-
-  //  	Double_t xPos[4] = {-48, -18,  12,  42};
-  Double_t xPos[4] = {-27, 0, 27, 54};
-  Double_t yPos[4] = {0, 0, 0, 0};
-  Double_t zPos[4] = {355, 355, 355, 355};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < nmRich; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else if (richGeomType == kQuarzPlate) {
-    pmtPlaneZ = QuarzPmtDistance + QuarzThickness / 2. + pmtThickness / 2.;
-  }
-  else {
-    pmtPlaneZ = aerogelPmtDistance + aerogelLength / 2. + pmtThickness / 2.;
-  }
-
-
-  TGeoTranslation* trAerogel = new TGeoTranslation(0., 0., 0.);
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuarzPlate(0., 0., 0.);
-  TGeoRotation rotQuarzPlate;
-  rotQuarzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuarzPlate = new TGeoCombiTrans(trQuarzPlate, rotQuarzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18g_mcbm");
-  top->AddNode(rich, 1);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol    = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol     = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol     = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-  TGeoVolume* pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI, 3 * pmtSizeHalf + pmtGap,
-                                            2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtVol     = gGeoMan->MakeBox("Pmt", medCsI, pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* QuarzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuarz, QuarzWidth / 2., QuarzHeight / 2., QuarzThickness / 2.);
-
-  //Aerogel box
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("AerogelBox", medAerogel, aerogelWidth / 2., aerogelHeight / 2., aerogelLength / 2.);
-
-  //Positioning
-  for (i = 0; i < nmRich; i++) {
-    rich->AddNode(caveVol, i + 1, trCave[i]);
-    //	  rich->AddNode(caveVol, 1, trCave[0]);
-  }
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else if (richGeomType == kQuarzPlate) {
-    gasVol->AddNode(QuarzVol, 1, combiTrQuarzPlate);
-  }
-  else {
-    gasVol->AddNode(aerogelVol, 1, trAerogel);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v18h_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v18h_mcbm.C
deleted file mode 100644
index 918b38a6b0..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v18h_mcbm.C
+++ /dev/null
@@ -1,388 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoSphere.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-using namespace std;
-
-// Changelog
-//
-// 2019-02-11 - v18h - DE - put mRICH v18g in vertical orientation
-// 2018-11-22 - v18g - DE - based on v18d - use 6x 3x2 PMT array as planned for mRICH 2019
-// 2018-01-18 - v18f - DE - change medium of PMT_pixel to N2 instead of CsI
-// 2018-01-18 - v18e - DE - use volume assembly instead of boxes for PMT_containder and PMT
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-enum RichGeomType
-{
-  kGlassLense,
-  kQuarzPlate,
-  kAerogel
-};
-
-void create_rich_v18h_mcbm()
-{
-  gSystem->Load("libGeom");
-  //gGeoMan = gGeoManager;// (TGeoManager*)gROOT->FindObject("FAIRGeom");
-  //new TGeoManager ("Testbox", "Testbox");
-
-  TGeoManager* gGeoMan = NULL;  // Pointer to TGeoManager instance
-
-  RichGeomType richGeomType = kAerogel;
-
-  TString geoFileName = "rich_v18h_mcbm.geo.root";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mCoating = geoMedia->getMedium("RICHglass");
-  if (mCoating == NULL) Fatal("Main", "FairMedium RICHglass not found");
-  geoBuild->createMedium(mCoating);
-  TGeoMedium* medCoating = gGeoMan->GetMedium("RICHglass");
-  if (medCoating == NULL) Fatal("Main", "Medium RICHglass not found");
-
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (mVacuum == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* medVacuum = gGeoMan->GetMedium("vacuum");
-  if (medVacuum == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mLenseGlass = geoMedia->getMedium("Rich_NBK7_glass");
-  if (mLenseGlass == NULL) Fatal("Main", "FairMedium Rich_NBK7_glass not found");
-  geoBuild->createMedium(mLenseGlass);
-  TGeoMedium* medLenseGlass = gGeoMan->GetMedium("Rich_NBK7_glass");
-  if (medLenseGlass == NULL) Fatal("Main", "Medium Rich_NBK7_glass  not found");
-
-  //	FairGeoMedium* mQuarz = geoMedia->getMedium("Rich_Quarz");
-  FairGeoMedium* mQuarz = geoMedia->getMedium("air");  // there is no Rich_Quarz in media.geo
-  if (mQuarz == NULL) Fatal("Main", "FairMedium Rich_Quarz not found");
-  geoBuild->createMedium(mQuarz);
-  //	TGeoMedium* medQuarz = gGeoMan->GetMedium("Rich_Quarz");
-  TGeoMedium* medQuarz = gGeoMan->GetMedium("air");  // there is no Rich_Quarz in media.geo
-  if (medQuarz == NULL) Fatal("Main", "Medium Rich_Quarz  not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-  //Dimensions of the RICH prototype [cm]
-  // Box
-  const Double_t boxLength    = 44;
-  const Double_t boxWidth     = 25;
-  const Double_t boxHeight    = 30;
-  const Double_t wallWidth    = 0.3;
-  const Double_t boxThickness = 0.1;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels     = 8;
-  const Double_t pmtSize          = 5.2;
-  const Double_t pmtSizeHalf      = pmtSize / 2.;
-  const Double_t pmtSensitiveSize = 4.85;
-  const Double_t pmtPixelSize     = pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf = pmtPixelSize / 2.;
-  const Double_t pmtGap           = 0.1;
-  const Double_t pmtGapHalf       = pmtGap / 2.;
-  const Double_t pmtPadding       = 0.175;
-  const Double_t pmtMatrixGap     = 0.3;  //3.5;
-  const Double_t pmtThickness     = 0.1;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Lense
-  const Double_t lenseCThickness  = 2.44;
-  const Double_t lenseRadius      = 15.51;
-  const Double_t lensePmtDistance = 3.0;
-  const Double_t lenseCoating     = 0.1;
-
-  // Quarz plate
-  const Double_t QuarzThickness   = 0.3;
-  const Double_t QuarzWidth       = 5.;
-  const Double_t QuarzHeight      = 5.;
-  const Double_t QuarzPmtDistance = 2.9;
-
-  // Absorber
-  const Double_t absorberThickness = 0.1;
-  const Double_t absorberRadius    = 0.0;  // 2.0;
-
-  // Aerogel Box
-  const Double_t aerogelLength      = 2.;
-  const Double_t aerogelWidth       = 20.;
-  const Double_t aerogelHeight      = 20.;
-  const Double_t aerogelPmtDistance = 10.;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  Int_t i;
-
-  const Int_t nmRich = 3;  // number of mRICH modules in the setup
-
-  TGeoRotation* rotBox   = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoRotation* rotmRich = new TGeoRotation("rotmRich", 0., 0., 0.);
-
-  //  	Double_t xPos[4] = {-48, -18, -48, -18};   // {-20,  20, -20,  20};
-  //  	Double_t yPos[4] = {-24, -24,  24,  24};   // {-20, -20,  20,  20};
-  //  	Double_t zPos[4] = {355, 355, 355, 355};   // { 50,  50,  50,  50};
-
-  //  	Double_t xPos[4] = {-48, -18,  12,  42};
-  Double_t xPos[4] = {-27, 0, 27, 54};
-  Double_t yPos[4] = {0, 0, 0, 0};
-  Double_t zPos[4] = {355, 355, 355, 355};
-  Double_t proto_angle[4];
-  TGeoRotation* proto_rotation[4];
-  TGeoCombiTrans* trCave[4];
-  //	TGeoTranslation* trCave[4];
-  //	TGeoTranslation *trCave= new TGeoTranslation(-48., 0., 280.);   // miniCBM position
-
-  for (i = 0; i < nmRich; i++) {
-    //          trCave[i]= new TGeoTranslation(xPos[i], yPos[i], zPos[i]);
-    proto_rotation[i] = new TGeoRotation();
-
-    // rotate around x axis
-    proto_angle[i] = atan(yPos[i] / sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i])) * 180 / acos(-1);
-    proto_rotation[i]->RotateX(-proto_angle[i]);
-
-    cout << "angle x" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "y " << yPos[i] << " t " << sqrt(xPos[i] * xPos[i] + zPos[i] * zPos[i]) << " cm" << endl;
-
-    // rotate around y axis
-    proto_angle[i] = atan(xPos[i] / zPos[i]) * 180 / acos(-1);
-    proto_rotation[i]->RotateY(proto_angle[i]);
-
-    cout << "angle y" << i << " " << proto_angle[i] << " deg" << endl;
-    cout << "x " << xPos[i] << " y " << yPos[i] << " cm" << endl;
-
-    cout << endl;
-    trCave[i] = new TGeoCombiTrans(xPos[i], yPos[i], zPos[i], proto_rotation[i]);
-  }
-
-  TGeoTranslation* trBox       = new TGeoTranslation(0., 0., 0.);  //Gasbox/Box Translation
-  TGeoTranslation* trSensPlane = new TGeoTranslation(0., 0., boxLength / 2. + sensPlaneBoxDistance);
-
-  Double_t pmtPlaneZ = 0.;
-  if (richGeomType == kGlassLense) { pmtPlaneZ = -(lenseRadius - lenseCThickness - lensePmtDistance); }
-  else if (richGeomType == kQuarzPlate) {
-    pmtPlaneZ = QuarzPmtDistance + QuarzThickness / 2. + pmtThickness / 2.;
-  }
-  else {
-    pmtPlaneZ = aerogelPmtDistance + aerogelLength / 2. + pmtThickness / 2.;
-  }
-
-
-  TGeoTranslation* trAerogel = new TGeoTranslation(0., 0., 0.);
-
-  Double_t pmtPlaneY              = pmtSize + pmtMatrixGap / 2. + pmtGap / 2.;
-  TGeoTranslation* trPmtPlaneUp   = new TGeoTranslation(0., pmtPlaneY, pmtPlaneZ);
-  TGeoTranslation* trPmtPlaneDown = new TGeoTranslation(0., -pmtPlaneY, pmtPlaneZ);
-
-  TGeoTranslation* trPmt1 = new TGeoTranslation(-pmtSize - pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt2 = new TGeoTranslation(0., pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSize + pmtGap, pmtSizeHalf + pmtGapHalf, 0.);
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSize - pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt5 = new TGeoTranslation(0., -pmtSizeHalf - pmtGapHalf, 0.);
-  TGeoTranslation* trPmt6 = new TGeoTranslation(pmtSize + pmtGap, -pmtSizeHalf - pmtGapHalf, 0.);
-
-  TGeoTranslation trQuarzPlate(0., 0., 0.);
-  TGeoRotation rotQuarzPlate;
-  rotQuarzPlate.SetAngles(0., 0., 0.);
-  TGeoCombiTrans* combiTrQuarzPlate = new TGeoCombiTrans(trQuarzPlate, rotQuarzPlate);
-
-  TGeoTranslation* trAbsorber = new TGeoTranslation(0., 0., -(lenseRadius - lenseCThickness) + absorberThickness / 2);
-
-  Double_t rotAngleLense = 0.;
-  TGeoTranslation trLense(0., -lenseRadius * TMath::ASin(TMath::DegToRad() * rotAngleLense), 0.);
-  TGeoRotation rotLense;
-  rotLense.SetAngles(0., rotAngleLense, 0.);
-  TGeoCombiTrans* combiTrLense = new TGeoCombiTrans(trLense, rotLense);
-
-  TGeoTranslation* trComp = new TGeoTranslation("trComp", 0., 0., -(lenseRadius - lenseCThickness) / 2 + 0.1);
-  trComp->RegisterYourself();
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, medAir);
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly("rich_v18h_mcbm");
-  // rotate around z axis
-  rotmRich->RotateZ(90);
-  top->AddNode(rich, 1, rotmRich);
-
-  //	TGeoVolume *caveVol = gGeoMan->MakeBox("rich_smallprototype_v17a", medAl, (boxWidth + boxThickness)/2. , (boxHeight + boxThickness)/2., (boxLength + boxThickness)/2.);
-  TGeoVolume* caveVol    = gGeoMan->MakeBox("rich_smallprototype", medAl, (boxWidth + boxThickness) / 2.,
-                                         (boxHeight + boxThickness) / 2., (boxLength + boxThickness) / 2.);
-  TGeoVolume* boxVol     = gGeoMan->MakeBox("Box", medNitrogen, boxWidth / 2., boxHeight / 2., boxLength / 2.);
-  TGeoVolume* gasVol     = gGeoMan->MakeBox("Gas", medNitrogen, boxWidth / 2 - wallWidth, boxHeight / 2 - wallWidth,
-                                        boxLength / 2 - wallWidth);
-  TGeoVolume* pmtContVol = gGeoMan->MakeBox("PmtContainer", medCsI, 3 * pmtSizeHalf + pmtGap,
-                                            2 * pmtSizeHalf + pmtGap / 2., pmtThickness / 2.);
-  TGeoVolume* pmtVol     = gGeoMan->MakeBox("Pmt", medCsI, pmtSizeHalf, pmtSizeHalf, pmtThickness / 2.);
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtThickness / 2.);
-
-  // Lense composite shape
-  TGeoSphere* lenseCoatingVol =
-    new TGeoSphere("LenseCoating", lenseRadius, lenseRadius + lenseCoating, 90., 180., 0., 360.);
-  TGeoSphere* lenseVol = new TGeoSphere("Lense", 0., lenseRadius, 90., 180., 0., 360.);
-  TGeoBBox* lenseCut   = new TGeoBBox("LenseCutShape", lenseRadius + lenseCoating, lenseRadius + lenseCoating,
-                                    (lenseRadius - lenseCThickness) / 2);
-  TGeoCompositeShape* lenseCompShape = new TGeoCompositeShape("LenseCompShape", "Lense-LenseCutShape:trComp");
-  TGeoCompositeShape* lenseCoatingCompShape =
-    new TGeoCompositeShape("LenseCoatingCompShape", "LenseCoating-LenseCutShape:trComp");
-  TGeoVolume* lenseCompVol        = new TGeoVolume("LenseComp", lenseCompShape, medLenseGlass);
-  TGeoVolume* lenseCoatingCompVol = new TGeoVolume("LenseCoatingComp", lenseCoatingCompShape, medCoating);
-
-  TGeoVolume* absorberVol  = gGeoMan->MakeTube("Absorber", medAl, 0., absorberRadius, absorberThickness / 2);
-  TGeoVolume* sensPlaneVol = gGeoMan->MakeBox("SensPlane", medCsI, sensPlaneSize / 2, sensPlaneSize / 2, 0.1);
-
-  // Quarz plate
-  TGeoVolume* QuarzVol =
-    gGeoMan->MakeBox("QuarzPlate", medQuarz, QuarzWidth / 2., QuarzHeight / 2., QuarzThickness / 2.);
-
-  //Aerogel box
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("AerogelBox", medAerogel, aerogelWidth / 2., aerogelHeight / 2., aerogelLength / 2.);
-
-  //Positioning
-  for (i = 0; i < nmRich; i++) {
-    rich->AddNode(caveVol, i + 1, trCave[i]);
-    //	  rich->AddNode(caveVol, 1, trCave[0]);
-  }
-
-  caveVol->AddNode(boxVol, 1, trBox);
-  if (isIncludeSensPlane) { caveVol->AddNode(sensPlaneVol, 1, trSensPlane); }
-
-  boxVol->AddNode(gasVol, 1, rotBox);
-
-  if (richGeomType == kGlassLense) {
-    gasVol->AddNode(lenseCoatingCompVol, 1, combiTrLense);
-    gasVol->AddNode(lenseCompVol, 1, combiTrLense);
-  }
-  else if (richGeomType == kQuarzPlate) {
-    gasVol->AddNode(QuarzVol, 1, combiTrQuarzPlate);
-  }
-  else {
-    gasVol->AddNode(aerogelVol, 1, trAerogel);
-  }
-
-  gasVol->AddNode(pmtContVol, 1, trPmtPlaneUp);
-  gasVol->AddNode(pmtContVol, 2, trPmtPlaneDown);
-
-  if (absorberRadius > 0.) { lenseCompVol->AddNode(absorberVol, 1, trAbsorber); }
-
-  pmtContVol->AddNode(pmtVol, 1, trPmt1);
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);
-  pmtContVol->AddNode(pmtVol, 4, trPmt4);
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      cout << "x:" << x << "  ";
-      TGeoTranslation* trij = new TGeoTranslation(x, y, 0.);
-      pmtVol->AddNode(pmtPixelVol, pmtNofPixels * i + j + 1, trij);
-    }
-    cout << endl;
-  }
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  lenseCoatingCompVol->SetLineColor(kCyan);
-  lenseCompVol->SetLineColor(kGreen);
-  boxVol->SetLineColor(kBlack);
-  gasVol->SetLineColor(kBlue);
-  pmtVol->SetLineColor(kOrange);
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(false);
-
-  //	boxVol->Draw("ogl");
-  top->Draw("ogl");
-  gGeoMan->SetVisLevel(6);
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v19a_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v19a_mcbm.C
deleted file mode 100644
index 6565e4d12d..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v19a_mcbm.C
+++ /dev/null
@@ -1,345 +0,0 @@
-/* Copyright (C) 2019 Justus-Liebig-Universitaet Giessen, Giessen
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Adrian Amatus Weber [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-//
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v19a_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v19a_mcbm.geo.root";
-  TString topNodeName = "rich_v19a_mcbm";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.15;
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-  //Global positioning
-  const Double_t boxFrontToTarget = 327. + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1), 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  rich->AddNode(boxVol, 1, trBox);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v19b_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v19b_mcbm.C
deleted file mode 100644
index e70699ac6d..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v19b_mcbm.C
+++ /dev/null
@@ -1,351 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-//
-// 2019-10-14 - v19b - DE - place mRICH between mSTS and mMUCH at z=65 cm
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v19b_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v19b_mcbm.geo.root";
-  TString topNodeName = "rich_v19b_mcbm";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.15;
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-  //Global positioning
-  //    const Double_t boxFrontToTarget = 327. + ItemToKapton + boxZLen/2;
-
-  const Double_t boxFrontToTarget = 65. + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    // do not tilt mRICH in upstream position - DE
-    //            rotBox->RotateX(0.955);//Tilting of Rich
-    //  trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1), 0, boxFrontToTarget, rotBox);
-    cout << "DEDE X pos: " << -pmtXShift - (pmtSize + pmtGap + 1) << endl;
-    trBox = new TGeoCombiTrans(0, 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  rich->AddNode(boxVol, 1, trBox);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v19c_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v19c_mcbm.C
deleted file mode 100644
index 8a76e62301..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v19c_mcbm.C
+++ /dev/null
@@ -1,348 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-//
-// 2019-11-28 - v19c - DE - move mRICH +12+7 cm in x direction (same as mTOF v19b) for the Nov 2019 run
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v19c_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v19c_mcbm.geo.root";
-  TString topNodeName = "rich_v19c_mcbm";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.15;
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-  //Global positioning
-  const Double_t boxFrontToTarget = 327. + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-                             // Nov 2019 run
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1) + 12. + 7., 0, boxFrontToTarget, rotBox);
-    //	    trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1), 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  rich->AddNode(boxVol, 1, trBox);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  //	rich->Export(geoFileName);   // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl << "Geometry written to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v19d_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v19d_mcbm.C
deleted file mode 100644
index fdb711aa22..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v19d_mcbm.C
+++ /dev/null
@@ -1,349 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-// 2020-04-02 - v19a - FU - same as v19a but with exported geometry in output file
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v19d_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v19d_mcbm.geo.root";
-  TString topNodeName = "rich_v19d_mcbm";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.15;
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-  //Global positioning
-  const Double_t boxFrontToTarget = 327. + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1), 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  //        rich->AddNode(boxVol, 1, trBox);
-  rich->AddNode(boxVol, 1);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-
-  gGeoMan->CheckOverlaps(0.0001, "s");
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  rich->Export(geoFileName);  // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  trBox->Write();
-  cout << endl << "Geometry exported to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v19e_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v19e_mcbm.C
deleted file mode 100644
index e809aa7cbc..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v19e_mcbm.C
+++ /dev/null
@@ -1,350 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-//
-// 2020-04-02 - v19a - FU - same as v19c but with exported geometry in output file
-// 2019-11-28 - v19c - DE - move mRICH +12+7 cm in x direction (same as mTOF v19b) for the Nov 2019 run
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v19e_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v19e_mcbm.geo.root";
-  TString topNodeName = "rich_v19e_mcbm";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.15;
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-  //Global positioning
-  const Double_t boxFrontToTarget = 327. + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-                             // Nov 2019 run
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1) + 12. + 7., 0, boxFrontToTarget, rotBox);
-    //	    trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1), 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  //        rich->AddNode(boxVol, 1, trBox);
-  rich->AddNode(boxVol, 1);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  rich->Export(geoFileName);  // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  trBox->Write();
-  cout << endl << "Geometry exported to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v20b_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v20b_mcbm.C
deleted file mode 100644
index 038bc731ad..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v20b_mcbm.C
+++ /dev/null
@@ -1,353 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-
-// 2020-05-06 - v20b - AW - changed positioning to center on 25° line (without Window)
-// 2020-04-02 - v19a - FU - same as v19c but with exported geometry in output file
-// 2019-11-28 - v19c - DE - move mRICH +12+7 cm in x direction (same as mTOF v19b) for the Nov 2019 run
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v20b_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v20b_mcbm.geo.root";
-  TString topNodeName = "rich_v20b_mcbm";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.00;  //0.15
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  //Global positioning
-  const Double_t boxFrontToTarget = 327. + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-                             // Nov 2019 run
-    //trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1)+12.+7., 0, boxFrontToTarget, rotBox);
-    // Mar2020
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1) + 6.3, 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  //        rich->AddNode(boxVol, 1, trBox);
-  rich->AddNode(boxVol, 1);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  rich->Export(geoFileName);  // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  trBox->Write();
-  cout << endl << "Geometry exported to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v20c_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v20c_mcbm.C
deleted file mode 100644
index b3a1eb90f4..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v20c_mcbm.C
+++ /dev/null
@@ -1,353 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-
-// 2020-05-06 - v20b - AW - changed positioning to center on 25° line (with Window)
-// 2020-04-02 - v19a - FU - same as v19c but with exported geometry in output file
-// 2019-11-28 - v19c - DE - move mRICH +12+7 cm in x direction (same as mTOF v19b) for the Nov 2019 run
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v20c_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v20c_mcbm.geo.root";
-  TString topNodeName = "rich_v20c_mcbm";
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.15;
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  //Global positioning
-  const Double_t boxFrontToTarget = 327. + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-                             // Nov 2019 run
-    //trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1)+12.+7., 0, boxFrontToTarget, rotBox);
-    // Mar2020
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1) + 6.3, 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  //        rich->AddNode(boxVol, 1, trBox);
-  rich->AddNode(boxVol, 1);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  rich->Export(geoFileName);  // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  trBox->Write();
-  cout << endl << "Geometry exported to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v20d_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v20d_mcbm.C
deleted file mode 100644
index 12b4c61e88..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v20d_mcbm.C
+++ /dev/null
@@ -1,357 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-
-// 2020-05-25 - v20d - AW - Move mRICH by +7.2cm in Z accordingly to the mTOF movement from rev 16441
-// 2020-05-20 - v20d - AW - changed positioning to +2.5cm to 25°line (nearer to beam axis) (from Analysis)
-// 2020-05-06 - v20b - AW - changed positioning to center on 25° line (without Window)
-// 2020-04-02 - v19a - FU - same as v19c but with exported geometry in output file
-// 2019-11-28 - v19c - DE - move mRICH +12+7 cm in x direction (same as mTOF v19b) for the Nov 2019 run
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v20d_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  TString geoFileName = "rich_v20d_mcbm.geo.root";
-  TString topNodeName = "rich_v20d_mcbm";
-
-  Double_t XOffset = 2.5;
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.00;  //0.15
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  //Global positioning
-  const Double_t boxFrontToTarget = 334.2 + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-                             // Nov 2019 run
-    //trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1)+12.+7., 0, boxFrontToTarget, rotBox);
-    // Mar2020
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1) + 6.3 + XOffset, 0, boxFrontToTarget, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  //        rich->AddNode(boxVol, 1, trBox);
-  rich->AddNode(boxVol, 1);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  rich->Export(geoFileName);  // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  trBox->Write();
-  cout << endl << "Geometry exported to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v21a_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v21a_mcbm.C
deleted file mode 100644
index 0322c46e66..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v21a_mcbm.C
+++ /dev/null
@@ -1,365 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-// clang-format off
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-
-// 2021-09-28 - v21a - SR - Based on v20d, moved RICH according to the TOF v21d
-// 2020-05-25 - v20d - AW - Move mRICH by +7.2cm in Z accordingly to the mTOF movement from rev 16441
-// 2020-05-20 - v20d - AW - changed positioning to +2.5cm to 25°line (nearer to beam axis) (from Analysis)
-// 2020-05-06 - v20b - AW - changed positioning to center on 25° line (without Window)
-// 2020-04-02 - v19a - FU - same as v19c but with exported geometry in output file
-// 2019-11-28 - v19c - DE - move mRICH +12+7 cm in x direction (same as mTOF v19b) for the Nov 2019 run
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v21a_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  TString geoFileName = "rich_v21a_mcbm.geo.root";
-  TString topNodeName = "rich_v21a_mcbm";
-
-  Double_t XOffset = 2.5;
-
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.00;  //0.15
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  //Global positioning
-  const Double_t boxFrontToTarget = 334.2 + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-    // Nov 2019 run
-    rotBox->RotateY(12.5);
-    //trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1)+12.+7., 0, boxFrontToTarget, rotBox);
-    // Mar2020
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1) + 6.3 + XOffset + 16. + 5., 0,
-                               boxFrontToTarget + 27., rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  //        rich->AddNode(boxVol, 1, trBox);
-  rich->AddNode(boxVol, 1);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  rich->Export(geoFileName);  // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  trBox->Write();
-  cout << endl << "Geometry exported to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/rich/create_rich_v21b_mcbm.C b/macro/mcbm/geometry/rich/create_rich_v21b_mcbm.C
deleted file mode 100644
index fbfa1229e1..0000000000
--- a/macro/mcbm/geometry/rich/create_rich_v21b_mcbm.C
+++ /dev/null
@@ -1,375 +0,0 @@
-/* Copyright (C) 2020-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig, David Emschermann [committer] */
-
-// clang-format off
-
-#include <iostream>
-//#include "FairGeoMedium.h"
-//#include "FairGeoBuilder.h"
-//#include "FairGeoMedia.h"
-#include "TGeoManager.h"
-#include "TGeoVolume.h"
-
-using namespace std;
-
-// Changelog
-
-// 2022-03-08 - v21b - DE - Based on v21a, relocate RICH along the rail onto the 25 degree line by -20 cm
-// 2021-09-28 - v21a - SR - Based on v20d, moved RICH according to the TOF v21d
-// 2020-05-25 - v20d - AW - Move mRICH by +7.2cm in Z accordingly to the mTOF movement from rev 16441
-// 2020-05-20 - v20d - AW - changed positioning to +2.5cm to 25°line (nearer to beam axis) (from Analysis)
-// 2020-05-06 - v20b - AW - changed positioning to center on 25° line (without Window)
-// 2020-04-02 - v19a - FU - same as v19c but with exported geometry in output file
-// 2019-11-28 - v19c - DE - move mRICH +12+7 cm in x direction (same as mTOF v19b) for the Nov 2019 run
-// 2017-11-17 - v18d - DE - add aerogel as radiator to the mRICH module
-// 2017-11-12 - v18c - DE - push mRICH downstream to z=355 cm for long setup
-// 2017-07-19 - v18b - DE - add one level to the geometry hierarchy
-// 2017-07-15 - v18b - DE - arrange 4x mRICH detectors in the setup and tilt towards target
-
-
-void create_rich_v21b_mcbm()
-{
-  gSystem->Load("libGeom");
-
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  TString geoFileName = "rich_v21b_mcbm.geo.root";
-  TString topNodeName = "rich_v21b_mcbm";
-
-  // displace RICH module along the rails on the TOF frame
-  Double_t XOffset = 0;
-  Double_t ZOffset = 0;
-
-  Double_t displacement_along_rails     = -20.0; // cm for Carbon-12 run
-  Double_t support_frame_rotation_angle =  12.5; // degrees
-
-  XOffset += +displacement_along_rails *cos( support_frame_rotation_angle * acos(-1)/180 );
-  ZOffset += -displacement_along_rails *sin( support_frame_rotation_angle * acos(-1)/180 );
-  // end of displacement along the rails
-  
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  //Media
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (mAluminium == NULL) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
-  if (medAl == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mKapton = geoMedia->getMedium("kapton");
-  if (mKapton == NULL) Fatal("Main", "FairMedium kapton not found");
-  geoBuild->createMedium(mKapton);
-  TGeoMedium* medKapton = gGeoMan->GetMedium("kapton");
-  if (medKapton == NULL) Fatal("Main", "Medium kapton not found");
-
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (mAir == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* medAir = gGeoMan->GetMedium("air");
-  if (medAir == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mPmtGlas = geoMedia->getMedium("PMTglass");
-  if (mPmtGlas == NULL) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mPmtGlas);
-  TGeoMedium* medPmtGlas = gGeoMan->GetMedium("PMTglass");
-  if (medPmtGlas == NULL) Fatal("Main", "Medium vacuum not found");
-
-  FairGeoMedium* mNitrogen = geoMedia->getMedium("RICHgas_N2_dis");
-  if (mNitrogen == NULL) Fatal("Main", "FairMedium RICHgas_N2_dis not found");
-  geoBuild->createMedium(mNitrogen);
-  TGeoMedium* medNitrogen = gGeoMan->GetMedium("RICHgas_N2_dis");
-  if (medNitrogen == NULL) Fatal("Main", "Medium RICHgas_N2_dis not found");
-
-  FairGeoMedium* mPMT = geoMedia->getMedium("CsI");
-  if (mPMT == NULL) Fatal("Main", "FairMedium CsI not found");
-  geoBuild->createMedium(mPMT);
-  TGeoMedium* medCsI = gGeoMan->GetMedium("CsI");
-  if (medCsI == NULL) Fatal("Main", "Medium CsI not found");
-
-  FairGeoMedium* mElectronic = geoMedia->getMedium("air");
-  if (mElectronic == NULL) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mElectronic);
-  TGeoMedium* medElectronic = gGeoMan->GetMedium("air");
-  if (medElectronic == NULL) Fatal("Main", "Medium air not found");
-
-  FairGeoMedium* mAerogel = geoMedia->getMedium("aerogel");
-  if (mAerogel == NULL) Fatal("Main", "FairMedium aerogel not found");
-  geoBuild->createMedium(mAerogel);
-  TGeoMedium* medAerogel = gGeoMan->GetMedium("aerogel");
-  if (medAerogel == NULL) Fatal("Main", "Medium aerogel  not found");
-
-
-  //Dimensions of the RICH prototype [cm]
-
-  const Double_t ItemToKapton = 1.85;
-
-  // Box
-  const Double_t boxThickness      = 0.3;
-  const Double_t boxBackThickness  = 1.;
-  const Double_t boxFrontThickness = 0.3;
-  const Double_t boxXLen           = 38.2;
-  const Double_t boxYLen           = 59.7;
-  const Double_t boxZLen           = 25. + boxBackThickness - ItemToKapton;
-  const Bool_t isRotate90DegZ      = false;
-
-  // PMT
-  // PMT specs https://www.hamamatsu.com/resources/pdf/etd/H12700_TPMH1348E.pdf
-  const Double_t pmtNofPixels          = 8;
-  const Double_t pmtSize               = 5.2;
-  const Double_t pmtSizeHalf           = pmtSize / 2.;
-  const Double_t pmtSensitiveSize      = 4.85;
-  const Double_t pmtPixelSize          = 0.6;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtPixelSizeHalf      = pmtPixelSize / 2.;
-  const Double_t pmtOuterPixelSize     = 0.625;  //pmtSensitiveSize / pmtNofPixels;
-  const Double_t pmtOuterPixelSizeHalf = pmtOuterPixelSize / 2.;
-  const Double_t pmtGap                = 0.1;
-  const Double_t pmtGapHalf            = pmtGap / 2.;
-  const Double_t pmtMatrixGap          = 0.1;
-  const Double_t pmtPixelThickness     = 0.1;
-  const Double_t pmtWindowThickness    = 0.00;  //0.15
-  Double_t pmtWindowPixelDistance      = 0.0;
-  if (pmtWindowThickness > 0.0) pmtWindowPixelDistance = 0.0;
-  const Double_t pmtThickness = pmtPixelThickness + pmtWindowThickness + pmtWindowPixelDistance;
-  const Double_t pmtZPadding  = 3.871;
-  const Double_t pmtXShift    = 2.5;
-
-  // Electronics
-  const Double_t elecLength = 10.;
-  const Double_t elecWidth  = 3. * pmtSize;
-  const Double_t elecHeight = 2. * pmtSize;
-
-  // Aerogel Box
-  const Double_t aerogelXLen        = 20.;
-  const Double_t aerogelYLen        = 20.;
-  const Double_t aerogelZLen        = 3.;
-  const Double_t aerogelPmtDistance = 10.;
-  const Double_t aerogelGap         = 0.1;
-
-  // Imaginary sensitive plane
-  Bool_t isIncludeSensPlane           = false;
-  const Double_t sensPlaneSize        = 200.;
-  const Double_t sensPlaneBoxDistance = 1.;
-
-  //Global positioning
-  const Double_t boxFrontToTarget = 334.2 + ItemToKapton + boxZLen / 2;
-
-  // Create the top volume
-  TGeoVolume* top = new TGeoVolumeAssembly("top");
-  gGeoMan->SetTopVolume(top);
-
-  // Rich assembly
-  TGeoVolume* rich = new TGeoVolumeAssembly(topNodeName);
-  top->AddNode(rich, 1);
-
-  // Al box
-  TGeoRotation* rotBox  = new TGeoRotation("rotBox", 0., 0., 0.);
-  TGeoCombiTrans* trBox = NULL;
-  if (isRotate90DegZ) {
-    rotBox->RotateZ(90.);
-    rotBox->RotateY(0.955);  //Tilting of Rich
-    trBox = new TGeoCombiTrans(0, -pmtXShift - (pmtSize + pmtGap + 1), boxFrontToTarget, rotBox);
-  }
-  else {
-    rotBox->RotateX(0.955);  //Tilting of Rich
-    // Nov 2019 run
-    rotBox->RotateY(support_frame_rotation_angle);
-    //trBox = new TGeoCombiTrans(-pmtXShift-(pmtSize + pmtGap + 1)+12.+7., 0, boxFrontToTarget, rotBox);
-    // Mar2020
-    trBox = new TGeoCombiTrans(-pmtXShift - (pmtSize + pmtGap + 1) + 6.3 + XOffset + 16. + 5. + 2.5, 0,
-                               boxFrontToTarget + 27. + ZOffset, rotBox);
-  }
-  TGeoVolume* boxVol = gGeoMan->MakeBox("box", medAl, boxXLen / 2., boxYLen / 2., boxZLen / 2.);
-  //        rich->AddNode(boxVol, 1, trBox);
-  rich->AddNode(boxVol, 1);
-
-  // Gas
-  TGeoVolume* gasVol = gGeoMan->MakeBox("Gas", medNitrogen, boxXLen / 2. - boxThickness, boxYLen / 2. - boxThickness,
-                                        ((boxZLen - boxBackThickness - boxFrontThickness) / 2.));
-  TGeoTranslation* trGas = new TGeoTranslation(0., 0., (-(boxBackThickness - boxFrontThickness) / 2.));
-  boxVol->AddNode(gasVol, 1, trGas);
-
-  // Front plane from kapton
-  TGeoVolume* kaptonVol     = gGeoMan->MakeBox("kapton", medKapton, boxXLen / 2. - boxThickness,
-                                           boxYLen / 2. - boxThickness, boxFrontThickness / 2.);
-  TGeoTranslation* trKapton = new TGeoTranslation(0., 0., -(boxZLen - boxFrontThickness) / 2.);
-  boxVol->AddNode(kaptonVol, 1, trKapton);
-
-
-  // Aerogel
-  TGeoVolume* aerogelVol =
-    gGeoMan->MakeBox("aerogel", medAerogel, aerogelXLen / 2., aerogelYLen / 2., aerogelZLen / 2.);
-  Double_t aerogelZ           = boxZLen / 2. - boxBackThickness - pmtZPadding - aerogelPmtDistance - aerogelZLen / 2.;
-  TGeoTranslation* trAerogel1 = new TGeoTranslation(pmtXShift, (aerogelYLen + aerogelGap) / 2., aerogelZ);
-  TGeoTranslation* trAerogel2 = new TGeoTranslation(pmtXShift, -(aerogelYLen + aerogelGap) / 2., aerogelZ);
-  gasVol->AddNode(aerogelVol, 1, trAerogel1);
-  gasVol->AddNode(aerogelVol, 2, trAerogel2);
-
-  // PMT
-  TGeoTranslation* trPmt1 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, -pmtSize - pmtGap, 0.);   // Bottom Right
-  TGeoTranslation* trPmt2 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, 0., 0.);                  // Middle Right
-  TGeoTranslation* trPmt3 = new TGeoTranslation(pmtSizeHalf + pmtGapHalf, pmtSize + pmtGap, 0.);    // Top Right
-  TGeoTranslation* trPmt4 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, -pmtSize - pmtGap, 0.);  // Bottom Left
-  TGeoTranslation* trPmt5 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, 0., 0.);                 // Middle Left
-  TGeoTranslation* trPmt6 = new TGeoTranslation(-pmtSizeHalf - pmtGapHalf, pmtSize + pmtGap, 0.);   // Top Left
-
-  TGeoVolume* pmtContVol = new TGeoVolumeAssembly("pmt_cont_vol");
-  TGeoVolume* pmtVol     = new TGeoVolumeAssembly("pmt_vol_0");
-  TGeoVolume* pmtVol_180 = new TGeoVolumeAssembly("pmt_vol_1");
-  TGeoVolume* pmtPixelVol =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_inner_outer =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtPixelSize / 2., pmtOuterPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtPixelVol_outer_inner =
-    gGeoMan->MakeBox("pmt_pixel", medCsI, pmtOuterPixelSize / 2., pmtPixelSize / 2., pmtPixelThickness / 2.);
-  TGeoVolume* pmtWindow = gGeoMan->MakeBox("pmt_Window", medPmtGlas, pmtSizeHalf, pmtSizeHalf, pmtWindowThickness / 2.);
-
-  pmtContVol->AddNode(pmtVol_180, 1, trPmt1);  // To Power Module    // Bottom Right
-  pmtContVol->AddNode(pmtVol, 2, trPmt2);      // Middle             // Middle Right
-  pmtContVol->AddNode(pmtVol, 3, trPmt3);      // To Combiner        // Top Right
-  pmtContVol->AddNode(pmtVol_180, 4, trPmt4);  // To Power Module    // Bottom Left
-  pmtContVol->AddNode(pmtVol, 5, trPmt5);      // Middle             // Middle Left
-  pmtContVol->AddNode(pmtVol, 6, trPmt6);      // To Combiner        // Top Left
-
-  Int_t halfPmtNofPixels = pmtNofPixels / 2;
-  for (Int_t i = 0; i < pmtNofPixels; i++) {
-    for (Int_t j = 0; j < pmtNofPixels; j++) {
-      //check outer Pixels
-
-      Double_t x   = 0.;
-      Double_t y   = 0.;
-      bool x_outer = false;
-      bool y_outer = false;
-
-      if (i == 0) {
-        x       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i == (pmtNofPixels - 1)) {
-        x       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        x_outer = true;
-      }
-      else if (i < halfPmtNofPixels) {
-        x       = -((halfPmtNofPixels - 1) - i) * pmtPixelSize - pmtPixelSizeHalf;
-        x_outer = false;
-      }
-      else {
-        x       = (i - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        x_outer = false;
-      }
-
-
-      if (j == 0) {
-        y       = -(halfPmtNofPixels - 1) * pmtPixelSize - pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j == (pmtNofPixels - 1)) {
-        y       = (halfPmtNofPixels - 1) * pmtPixelSize + pmtOuterPixelSizeHalf;
-        y_outer = true;
-      }
-      else if (j < halfPmtNofPixels) {
-        y       = -((halfPmtNofPixels - 1) - j) * pmtPixelSize - pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      else {
-        y       = (j - halfPmtNofPixels) * pmtPixelSize + pmtPixelSizeHalf;
-        y_outer = false;
-      }
-      //Double_t x = (i - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-
-      //Double_t y = (j - (halfPmtNofPixels - 1)) * pmtPixelSize - pmtPixelSizeHalf;
-      TGeoTranslation* trij = new TGeoTranslation(x, y, -pmtPixelThickness / 2. + pmtThickness / 2.);
-
-      //normal rotated PMT (HV connector at lower side)
-      uint uid = 18 - ((j % 4) / 2) * 16 - (j % 2) + 2 * i + (1 - (j / 4)) * 100;
-
-      //180?? rotated PMT
-      uint uid_180 = 15 + ((j % 4) / 2) * 16 + (j % 2) - 2 * i + (1 - (j / 4)) * 100;
-      if (x_outer == true && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_outer_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_outer, uid_180, trij);
-      }
-      else if (x_outer == true && y_outer == false) {
-        pmtVol->AddNode(pmtPixelVol_outer_inner, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_outer_inner, uid_180, trij);
-      }
-      else if (x_outer == false && y_outer == true) {
-        pmtVol->AddNode(pmtPixelVol_inner_outer, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol_inner_outer, uid_180, trij);
-      }
-      else {
-        pmtVol->AddNode(pmtPixelVol, uid, trij);
-        pmtVol_180->AddNode(pmtPixelVol, uid_180, trij);
-      }
-    }
-  }
-
-  TGeoTranslation* trWndw = new TGeoTranslation(0., 0., +pmtWindowThickness / 2. - pmtThickness / 2.);
-  if (pmtWindowThickness > 0.0) {
-    pmtVol->AddNode(pmtWindow, 1, trWndw);
-    pmtVol_180->AddNode(pmtWindow, 1, trWndw);
-  }
-
-  //
-  Double_t pmtContXLen        = 2 * (pmtSize + pmtGap);
-  Double_t pmtContYLen        = 3 * (pmtSize + pmtGap);
-  TGeoTranslation* trPmtCont1 = new TGeoTranslation(-pmtContXLen / 2., pmtContYLen, 0.);   //Top Left
-  TGeoTranslation* trPmtCont2 = new TGeoTranslation(-pmtContXLen / 2., 0., 0.);            //Middle Left
-  TGeoTranslation* trPmtCont3 = new TGeoTranslation(-pmtContXLen / 2., -pmtContYLen, 0.);  //Bottom Left
-  TGeoTranslation* trPmtCont4 = new TGeoTranslation(pmtContXLen / 2., pmtContYLen, 0.);    //
-  TGeoTranslation* trPmtCont5 = new TGeoTranslation(pmtContXLen / 2., 0., 0.);             //
-  TGeoTranslation* trPmtCont6 = new TGeoTranslation(pmtContXLen / 2., -pmtContYLen, 0.);   //
-
-  TGeoVolume* pmtPlaneVol = new TGeoVolumeAssembly("pmt_plane");
-  pmtPlaneVol->AddNode(pmtContVol, 00,
-                       trPmtCont1);  // Id gives the Address 0x7**0 of the top left DiRICH in a BP  (X|Y)
-  pmtPlaneVol->AddNode(pmtContVol, 03, trPmtCont2);
-  pmtPlaneVol->AddNode(pmtContVol, 06, trPmtCont3);
-  pmtPlaneVol->AddNode(pmtContVol, 20, trPmtCont4);
-  pmtPlaneVol->AddNode(pmtContVol, 23, trPmtCont5);
-  pmtPlaneVol->AddNode(pmtContVol, 26, trPmtCont6);
-
-  TGeoTranslation* trPmtPlane =
-    new TGeoTranslation(pmtXShift, 0., boxZLen / 2. - boxBackThickness - pmtZPadding + (pmtThickness / 2.));
-  gasVol->AddNode(pmtPlaneVol, 1, trPmtPlane);
-
-
-  gGeoMan->CheckOverlaps();
-  gGeoMan->PrintOverlaps();
-
-  //Draw
-  pmtPixelVol->SetLineColor(kYellow + 4);
-  aerogelVol->SetLineColor(kCyan);
-  aerogelVol->SetTransparency(70);
-  gasVol->SetLineColor(kGreen);
-  gasVol->SetTransparency(60);
-  kaptonVol->SetLineColor(kBlue);
-  kaptonVol->SetTransparency(70);
-
-
-  //gGeoMan->SetTopVisible();
-  //boxVol->SetVisibility(true);
-
-  //	boxVol->Draw("ogl");
-  //top->Draw("ogl");
-  gGeoMan->SetVisLevel(7);  //7
-
-  rich->Export(geoFileName);  // an alternative way of writing the trd volume
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  trBox->Write();
-  cout << endl << "Geometry exported to " << geoFileName << endl;
-  geoFile->Close();
-}
diff --git a/macro/mcbm/geometry/sts/.rootrc b/macro/mcbm/geometry/sts/.rootrc
deleted file mode 120000
index 3a0c80486b..0000000000
--- a/macro/mcbm/geometry/sts/.rootrc
+++ /dev/null
@@ -1 +0,0 @@
-../../../include/.rootrc
\ No newline at end of file
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18a.C b/macro/mcbm/geometry/sts/create_stsgeo_v18a.C
deleted file mode 100644
index 3ab1a60a85..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18a.C
+++ /dev/null
@@ -1,1784 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18b.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTrd2.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 0.00;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-Double_t BeamPipeRadius(Double_t z);
-TGeoVolume* ConstructCone(Double_t coneDz);
-TGeoVolume* ConstructFrameBox(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(const char* name, Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18a(const char* geoTag = "v18a")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18a.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness                   = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain       = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors        = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors      = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness                    = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  TString name   = "";
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    name               = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    TString name       = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  //  ladderTypes[3] = 2;   // 1;
-  //  ladderTypes[4] = 21;   // 1;
-  //  ladderTypes[5] = 2;
-  //  ladderTypes[6] = 2;
-  //  ladderTypes[7] = 3;
-  TGeoVolume* station01 = ConstructStation("Station01", 0, nLadders, ladderTypes, rHole);
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  //  ladderTypes[3]  = 2;
-  //  ladderTypes[4]  = 2;
-  //  ladderTypes[5]  = 1;
-  //  ladderTypes[6]  = 1;
-  //  ladderTypes[7]  = 2;
-  //  ladderTypes[8]  = 2;
-  //  ladderTypes[9]  = 3;
-  //  ladderTypes[10] = 3;
-  //  ladderTypes[11] = 4;
-  TGeoVolume* station02 = ConstructStation("Station02", 1, nLadders, ladderTypes, rHole);
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 8;
-  //  ladderTypes[1]  = 7;
-  //  ladderTypes[2]  = 6;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 22;   // 5;
-  //  ladderTypes[6]  = 22;   // 5;
-  //  ladderTypes[7]  = 6;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 7;
-  //  ladderTypes[11] = 8;
-  //  TGeoVolume* station03 = ConstructStation("Station03", 2, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 9;
-  //  ladderTypes[1]  = 8;
-  //  ladderTypes[2]  = 7;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 6;
-  //  ladderTypes[6]  = 5;
-  //  ladderTypes[7]  = 5;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 6;
-  //  ladderTypes[11] = 7;
-  //  ladderTypes[12] = 8;
-  //  ladderTypes[13] = 9;
-  //  TGeoVolume* station04 = ConstructStation("Station04", 3, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 23;   // 10;
-  //  ladderTypes[7]  = 23;   // 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station05 = ConstructStation("Station05", 4, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  // --- same as station 05
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 10;
-  //  ladderTypes[7]  = 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station06 = ConstructStation("Station06", 5, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.3;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 17;
-  //  ladderTypes[1]  = 14;
-  //  ladderTypes[2]  = 13;
-  //  ladderTypes[3]  = 16;
-  //  ladderTypes[4]  = 16;
-  //  ladderTypes[5]  = 16;
-  //  ladderTypes[6]  = 16;
-  //  ladderTypes[7]  = 15;
-  //  ladderTypes[8]  = 15;
-  //  ladderTypes[9]  = 16;
-  //  ladderTypes[10] = 16;
-  //  ladderTypes[11] = 16;
-  //  ladderTypes[12] = 16;
-  //  ladderTypes[13] = 13;
-  //  ladderTypes[14] = 14;
-  //  ladderTypes[15] = 17;
-  //  TGeoVolume* station07 = ConstructStation("Station07", 6, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  // --- same as station 07
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.5;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 12;
-  //  ladderTypes[2]  = 20;
-  //  ladderTypes[3]  = 19;
-  //  ladderTypes[4]  = 19;
-  //  ladderTypes[5]  = 19;
-  //  ladderTypes[6]  = 19;
-  //  ladderTypes[7]  = 18;
-  //  ladderTypes[8]  = 18;
-  //  ladderTypes[9]  = 19;
-  //  ladderTypes[10] = 19;
-  //  ladderTypes[11] = 19;
-  //  ladderTypes[12] = 19;
-  //  ladderTypes[13] = 20;
-  //  ladderTypes[14] = 12;
-  //  ladderTypes[15] = 14;
-  //  TGeoVolume* station08 = ConstructStation("Station08", 7, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  //  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 5.;
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[7] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[7] + statPos[0]);
-
-  // --- Create box  around the stations
-  new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-
-  // --- Create cone hosting the beam pipe
-  // --- One straight section with constant radius followed by a cone
-  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  Double_t z2 = gkPipeZ2;
-  Double_t z3 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  Double_t r1 = BeamPipeRadius(z1);
-  Double_t r2 = BeamPipeRadius(z2);
-  Double_t r3 = BeamPipeRadius(z3);
-  r1 += 0.01;  // safety margin
-  r2 += 0.01;  // safety margin
-  r3 += 0.01;  // safety margin
-  cout << endl;
-  cout << z1 << "  " << r1 << endl;
-  cout << z2 << "  " << r2 << endl;
-  cout << z3 << "  " << r3 << endl;
-
-  cout << endl;
-
-  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-
-  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  cutout->DefineSection(0, z1, 0., r1);
-  //  cutout->DefineSection(1, z2, 0., r2);
-  //  cutout->DefineSection(2, z3, 0., r3);
-  new TGeoTrd2("stsCone1", r1, r2, r1, r2,
-               (z2 - z1) / 2. + .1);  // add .1 in z length for a clean cutout
-  TGeoTranslation* trans1 = new TGeoTranslation("trans1", 0., 0., -(z3 - z1) / 2. + (z2 - z1) / 2.);
-  trans1->RegisterYourself();
-  new TGeoTrd2("stsCone2", r2, r3, r2, r3,
-               (z3 - z2) / 2. + .1);  // add .1 in z length for a clean cutout
-  TGeoTranslation* trans2 = new TGeoTranslation("trans2", 0., 0., +(z3 - z1) / 2. - (z3 - z2) / 2.);
-  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  TString stsName = "sts_";
-  stsName += geoTag;
-  TGeoShape* stsShape = new TGeoCompositeShape("stsShape", "stsBox-stsCone1:trans1-stsCone2:trans2");
-  TGeoVolume* sts     = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder01", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21 x-mirror of 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder("Ladder21", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 2 2 2 3 4 4
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder02d", 0, sectorTypes, 'r');
-  ConstructLadder("Ladder02", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03: 10 sectors, type 4 4 3 2 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 3;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder03", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder04", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder05", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 22 x-mirror of 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder("Ladder22", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder06", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder07", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 6 sensors, type 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder08", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 10 sectors, type 5 4 4 5
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder09", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder10", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23 x-mirror of 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder23", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder11", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder12", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder13", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder14", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap, same height as Ladder 05
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap("Ladder15", halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder16", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder17", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap("Ladder18", halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 19: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder19", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder20", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-TGeoVolume* ConstructLadder(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-TGeoVolume* ConstructLadderWithGap(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-TGeoVolume* ConstructStation(const char* name, Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-  TString tubName(name);
-  tubName += "_tub";
-  TString expression = boxName + "-" + tubName;
-  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  TGeoBBox* statTub   = new TGeoBBox(tubName, rHole, rHole, statZ / 2.);
-  statShape           = new TGeoCompositeShape(name, expression.Data());
-  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (iStation % 2 == 0)  // flip ladders for even stations to reproduce CAD layout
-    // even station 0,2,4,6
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) {
-        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders
-      else {
-        zPos = -0.5 * gkLadderGapZ - shape->GetDZ();
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) { zPos = -0.5 * gkLadderGapZ - shape->GetDZ(); }
-      // --- Rotated ladders
-      else {
-        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z                             
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18b.C b/macro/mcbm/geometry/sts/create_stsgeo_v18b.C
deleted file mode 100644
index d0e77626e0..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18b.C
+++ /dev/null
@@ -1,1784 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18b.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTrd2.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 0.00;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-Double_t BeamPipeRadius(Double_t z);
-TGeoVolume* ConstructCone(Double_t coneDz);
-TGeoVolume* ConstructFrameBox(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(const char* name, Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18b(const char* geoTag = "v18b")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18b.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness                   = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain       = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors        = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors      = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness                    = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  TString name   = "";
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    name               = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    TString name       = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 4;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  ladderTypes[3] = 2;  // 1;
-                       //  ladderTypes[4] = 21;   // 1;
-                       //  ladderTypes[5] = 2;
-                       //  ladderTypes[6] = 2;
-                       //  ladderTypes[7] = 3;
-  TGeoVolume* station01 = ConstructStation("Station01", 0, nLadders, ladderTypes, rHole);
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 4;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  ladderTypes[3] = 2;
-  //  ladderTypes[4]  = 2;
-  //  ladderTypes[5]  = 1;
-  //  ladderTypes[6]  = 1;
-  //  ladderTypes[7]  = 2;
-  //  ladderTypes[8]  = 2;
-  //  ladderTypes[9]  = 3;
-  //  ladderTypes[10] = 3;
-  //  ladderTypes[11] = 4;
-  TGeoVolume* station02 = ConstructStation("Station02", 1, nLadders, ladderTypes, rHole);
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 8;
-  //  ladderTypes[1]  = 7;
-  //  ladderTypes[2]  = 6;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 22;   // 5;
-  //  ladderTypes[6]  = 22;   // 5;
-  //  ladderTypes[7]  = 6;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 7;
-  //  ladderTypes[11] = 8;
-  //  TGeoVolume* station03 = ConstructStation("Station03", 2, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 9;
-  //  ladderTypes[1]  = 8;
-  //  ladderTypes[2]  = 7;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 6;
-  //  ladderTypes[6]  = 5;
-  //  ladderTypes[7]  = 5;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 6;
-  //  ladderTypes[11] = 7;
-  //  ladderTypes[12] = 8;
-  //  ladderTypes[13] = 9;
-  //  TGeoVolume* station04 = ConstructStation("Station04", 3, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 23;   // 10;
-  //  ladderTypes[7]  = 23;   // 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station05 = ConstructStation("Station05", 4, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  // --- same as station 05
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 10;
-  //  ladderTypes[7]  = 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station06 = ConstructStation("Station06", 5, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.3;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 17;
-  //  ladderTypes[1]  = 14;
-  //  ladderTypes[2]  = 13;
-  //  ladderTypes[3]  = 16;
-  //  ladderTypes[4]  = 16;
-  //  ladderTypes[5]  = 16;
-  //  ladderTypes[6]  = 16;
-  //  ladderTypes[7]  = 15;
-  //  ladderTypes[8]  = 15;
-  //  ladderTypes[9]  = 16;
-  //  ladderTypes[10] = 16;
-  //  ladderTypes[11] = 16;
-  //  ladderTypes[12] = 16;
-  //  ladderTypes[13] = 13;
-  //  ladderTypes[14] = 14;
-  //  ladderTypes[15] = 17;
-  //  TGeoVolume* station07 = ConstructStation("Station07", 6, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  // --- same as station 07
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.5;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 12;
-  //  ladderTypes[2]  = 20;
-  //  ladderTypes[3]  = 19;
-  //  ladderTypes[4]  = 19;
-  //  ladderTypes[5]  = 19;
-  //  ladderTypes[6]  = 19;
-  //  ladderTypes[7]  = 18;
-  //  ladderTypes[8]  = 18;
-  //  ladderTypes[9]  = 19;
-  //  ladderTypes[10] = 19;
-  //  ladderTypes[11] = 19;
-  //  ladderTypes[12] = 19;
-  //  ladderTypes[13] = 20;
-  //  ladderTypes[14] = 12;
-  //  ladderTypes[15] = 14;
-  //  TGeoVolume* station08 = ConstructStation("Station08", 7, nLadders, ladderTypes, rHole);
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  //  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 5.;
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[7] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[7] + statPos[0]);
-
-  // --- Create box  around the stations
-  new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-
-  // --- Create cone hosting the beam pipe
-  // --- One straight section with constant radius followed by a cone
-  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  Double_t z2 = gkPipeZ2;
-  Double_t z3 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  Double_t r1 = BeamPipeRadius(z1);
-  Double_t r2 = BeamPipeRadius(z2);
-  Double_t r3 = BeamPipeRadius(z3);
-  r1 += 0.01;  // safety margin
-  r2 += 0.01;  // safety margin
-  r3 += 0.01;  // safety margin
-  cout << endl;
-  cout << z1 << "  " << r1 << endl;
-  cout << z2 << "  " << r2 << endl;
-  cout << z3 << "  " << r3 << endl;
-
-  cout << endl;
-
-  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-
-  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  cutout->DefineSection(0, z1, 0., r1);
-  //  cutout->DefineSection(1, z2, 0., r2);
-  //  cutout->DefineSection(2, z3, 0., r3);
-  new TGeoTrd2("stsCone1", r1, r2, r1, r2,
-               (z2 - z1) / 2. + .1);  // add .1 in z length for a clean cutout
-  TGeoTranslation* trans1 = new TGeoTranslation("trans1", 0., 0., -(z3 - z1) / 2. + (z2 - z1) / 2.);
-  trans1->RegisterYourself();
-  new TGeoTrd2("stsCone2", r2, r3, r2, r3,
-               (z3 - z2) / 2. + .1);  // add .1 in z length for a clean cutout
-  TGeoTranslation* trans2 = new TGeoTranslation("trans2", 0., 0., +(z3 - z1) / 2. - (z3 - z2) / 2.);
-  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  TString stsName = "sts_";
-  stsName += geoTag;
-  TGeoShape* stsShape = new TGeoCompositeShape("stsShape", "stsBox-stsCone1:trans1-stsCone2:trans2");
-  TGeoVolume* sts     = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder01", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21 x-mirror of 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder("Ladder21", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 2 2 2 3 4 4
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder02d", 0, sectorTypes, 'r');
-  ConstructLadder("Ladder02", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03: 10 sectors, type 4 4 3 2 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 3;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder03", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder04", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder05", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 22 x-mirror of 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder("Ladder22", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder06", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  ConstructLadder("Ladder07", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 6 sensors, type 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder08", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 10 sectors, type 5 4 4 5
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder09", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder10", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23 x-mirror of 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder23", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder11", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder12", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder13", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder14", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap, same height as Ladder 05
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap("Ladder15", halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder16", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder17", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap("Ladder18", halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 19: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder19", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder("Ladder20", halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-TGeoVolume* ConstructLadder(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-TGeoVolume* ConstructLadderWithGap(const char* name, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-TGeoVolume* ConstructStation(const char* name, Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-  TString tubName(name);
-  tubName += "_tub";
-  TString expression = boxName + "-" + tubName;
-  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  TGeoBBox* statTub   = new TGeoBBox(tubName, rHole, rHole, statZ / 2.);
-  statShape           = new TGeoCompositeShape(name, expression.Data());
-  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (iStation % 2 == 0)  // flip ladders for even stations to reproduce CAD layout
-    // even station 0,2,4,6
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) {
-        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders
-      else {
-        zPos = -0.5 * gkLadderGapZ - shape->GetDZ();
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) { zPos = -0.5 * gkLadderGapZ - shape->GetDZ(); }
-      // --- Rotated ladders
-      else {
-        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z                             
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18c.C b/macro/mcbm/geometry/sts/create_stsgeo_v18c.C
deleted file mode 100644
index 50fd220b2b..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18c.C
+++ /dev/null
@@ -1,2159 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v13x.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18c: (causes segfault due to divide) 2 stations of 4x4 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** @date 25.07.2014
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** modify cutout in STS keeping volume to fit beampipes v14e,f,g,h,i,j
- **
- ** v13z: derived from v13y with carbon ladders from v13e included - orientation matches CAD design
- ** v13y: derived from v13x with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences between v13x and v13d:
-// Increased radius of cutout for the beam pipe in the station volumes.
-// The values are now adapted to the actual aperture of the station.
-// Changed cutout for the beam pipe in the STS volume to follow the new
-// beam pipe design v14. The cutout is now a TGeoPcon instead of a TGeoCone.
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTrd2.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.24;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 0.00;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;
-const Bool_t gkConstructFrames      = kTRUE;  // kFALSE;
-const Bool_t gkConstructSmallFrames = kTRUE;  // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.;
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-Double_t BeamPipeRadius(Double_t z);
-TGeoVolume* ConstructCone(Double_t coneDz);
-TGeoVolume* ConstructFrameBox(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18c(const char* geoTag = "v18c")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18c.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  CbmStsSensorFactory* sensFac = CbmStsSensorFactory::Instance();
-  Int_t nSensors               = sensFac->GetNofSensors();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoVolume* sensor = sensFac->GetSensor(iSensor);
-    CheckVolume(sensor, infoFile);
-  }
-
-
-  /*
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name = Form("Sensor%02d",iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1)
-      sensor->SetLineColor(kYellow);
-    if (iSensor == 2)
-      sensor->SetLineColor(kRed);
-    if (iSensor == 3)
-      sensor->SetLineColor(kGreen);
-    if (iSensor == 4)
-      sensor->SetLineColor(kBlue);
-    if (iSensor == 5)
-      sensor->SetLineColor(kYellow);
-    if (iSensor == 6)
-      sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  TString name   = "";
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    name               = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    TString name       = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz       = 1.64;
-  TGeoVolume* coneVolum = ConstructCone(coneDz);
-  if (!coneVolum) Fatal("ConstructCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 1.83;
-  nLadders       = 3;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  //  ladderTypes[3] = 18;  // 1;
-  //  ladderTypes[4] = 18;  // 1;
-  //  ladderTypes[5] = 2;
-  //  ladderTypes[6] = 2;
-  //  ladderTypes[7] = 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    TGeoRotation* coneRot11      = new TGeoRotation(name + "coneRot1", +90., 0., 0.);
-    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.3, coneRot11);
-    station01->AddNode(coneVolum, 1, conePosRot11);
-
-    TGeoRotation* coneRot12      = new TGeoRotation(name + "coneRot2", +90., 180., 0.);
-    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.3, coneRot12);
-    station01->AddNode(coneVolum, 2, conePosRot12);
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 1.83;
-  nLadders       = 3;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  //  ladderTypes[3]  = 2;
-  //  ladderTypes[4]  = 2;
-  //  ladderTypes[5]  = 1;
-  //  ladderTypes[6]  = 1;
-  //  ladderTypes[7]  = 2;
-  //  ladderTypes[8]  = 2;
-  //  ladderTypes[9]  = 3;
-  //  ladderTypes[10] = 3;
-  //  ladderTypes[11] = 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    TGeoRotation* coneRot21      = new TGeoRotation(name + "coneRot1", -90., 0., 0.);
-    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.3, coneRot21);
-    station02->AddNode(coneVolum, 1, conePosRot21);
-
-    TGeoRotation* coneRot22      = new TGeoRotation(name + "coneRot2", -90., 180., 0.);
-    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.3, coneRot22);
-    station02->AddNode(coneVolum, 2, conePosRot22);
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.74;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 8;
-  //  ladderTypes[1]  = 7;
-  //  ladderTypes[2]  = 6;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 19;  // 5;
-  //  ladderTypes[6]  = 19;  // 5;
-  //  ladderTypes[7]  = 6;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 7;
-  //  ladderTypes[11] = 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot31 = new TGeoRotation (name+"coneRot1", +90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot31);
-  //    station03->AddNode(coneVolum, 1, conePosRot31);
-  //
-  //    TGeoRotation* coneRot32 = new TGeoRotation (name+"coneRot2", +90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot32);
-  //    station03->AddNode(coneVolum, 2, conePosRot32);
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.74;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 9;
-  //  ladderTypes[1]  = 8;
-  //  ladderTypes[2]  = 7;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 6;
-  //  ladderTypes[6]  = 5;
-  //  ladderTypes[7]  = 5;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 6;
-  //  ladderTypes[11] = 7;
-  //  ladderTypes[12] = 8;
-  //  ladderTypes[13] = 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot41 = new TGeoRotation (name+"coneRot1", -90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot41);
-  //    station04->AddNode(coneVolum, 1, conePosRot41);
-  //
-  //    TGeoRotation* coneRot42 = new TGeoRotation (name+"coneRot2", -90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot42);
-  //    station04->AddNode(coneVolum, 2, conePosRot42);
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.73;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 20;  // 10;
-  //  ladderTypes[7]  = 20;  // 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot51 = new TGeoRotation (name+"coneRot1", +90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot51);
-  //    station05->AddNode(coneVolum, 1, conePosRot51);
-  //
-  //    TGeoRotation* coneRot52 = new TGeoRotation (name+"coneRot2", +90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot52);
-  //    station05->AddNode(coneVolum, 2, conePosRot52);
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  // --- same as station 05
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.73;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 10;
-  //  ladderTypes[7]  = 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot61 = new TGeoRotation (name+"coneRot1", -90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot61);
-  //    station06->AddNode(coneVolum, 1, conePosRot61);
-  //
-  //    TGeoRotation* coneRot62 = new TGeoRotation (name+"coneRot2", -90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot62);
-  //    station06->AddNode(coneVolum, 2, conePosRot62);
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.20; // 4.39;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 17;
-  //  ladderTypes[3]  = 17;
-  //  ladderTypes[4]  = 16;
-  //  ladderTypes[5]  = 16;
-  //  ladderTypes[6]  = 16;
-  //  ladderTypes[7]  = 15;
-  //  ladderTypes[8]  = 15;
-  //  ladderTypes[9]  = 16;
-  //  ladderTypes[10] = 16;
-  //  ladderTypes[11] = 16;
-  //  ladderTypes[12] = 17;
-  //  ladderTypes[13] = 17;
-  //  ladderTypes[14] = 13;
-  //  ladderTypes[15] = 14;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot71 = new TGeoRotation (name+"coneRot1", +90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot71);
-  //    station07->AddNode(coneVolum, 1, conePosRot71);
-  //
-  //    TGeoRotation* coneRot72 = new TGeoRotation (name+"coneRot2", +90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot72);
-  //    station07->AddNode(coneVolum, 2, conePosRot72);
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  // --- same as station 07
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.20; // 4.39;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 17;
-  //  ladderTypes[3]  = 17;
-  //  ladderTypes[4]  = 16;
-  //  ladderTypes[5]  = 16;
-  //  ladderTypes[6]  = 16;
-  //  ladderTypes[7]  = 15;
-  //  ladderTypes[8]  = 15;
-  //  ladderTypes[9]  = 16;
-  //  ladderTypes[10] = 16;
-  //  ladderTypes[11] = 16;
-  //  ladderTypes[12] = 17;
-  //  ladderTypes[13] = 17;
-  //  ladderTypes[14] = 13;
-  //  ladderTypes[15] = 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot81 = new TGeoRotation (name+"coneRot1", -90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot81);
-  //    station08->AddNode(coneVolum, 1, conePosRot81);
-  //
-  //    TGeoRotation* coneRot82 = new TGeoRotation (name+"coneRot2", -90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot82);
-  //    station08->AddNode(coneVolum, 2, conePosRot82);
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[7] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[7] + statPos[0]);
-
-  // --- Create box  around the stations
-  new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  // --- Create cone hosting the beam pipe
-  // --- One straight section with constant radius followed by a cone
-  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  Double_t z2 = gkPipeZ2;
-  Double_t z3 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  Double_t r1 = BeamPipeRadius(z1);
-  Double_t r2 = BeamPipeRadius(z2);
-  Double_t r3 = BeamPipeRadius(z3);
-  r1 += 0.01;  // safety margin
-  r2 += 0.01;  // safety margin
-  r3 += 0.01;  // safety margin
-  cout << z1 << "  " << r1 << endl;
-  cout << z2 << "  " << r2 << endl;
-  cout << z3 << "  " << r3 << endl;
-  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  cutout->DefineSection(0, z1, 0., r1);
-  //  cutout->DefineSection(1, z2, 0., r2);
-  //  cutout->DefineSection(2, z3, 0., r3);
-  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2 - z1) / 2.);
-  TGeoTranslation* trans1 = new TGeoTranslation("trans1", 0., 0., -(z3 - z1) / 2. + (z2 - z1) / 2.);
-  trans1->RegisterYourself();
-  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3 - z2) / 2.);
-  TGeoTranslation* trans2 = new TGeoTranslation("trans2", 0., 0., +(z3 - z1) / 2. - (z3 - z2) / 2.);
-  trans2->RegisterYourself();
-
-  // --- Create STS volume
-  TString stsName = "sts_";
-  stsName += geoTag;
-  TGeoShape* stsShape = new TGeoCompositeShape("stsShape", "stsBox-stsCone1:trans1-stsCone2:trans2");
-  TGeoVolume* sts     = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  top->Export(geoFileName_);
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4.0 cm x 2.2 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.1992;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.1992;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.1992;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 3.1 cm)
-  xSize                    = 3.1;
-  ySize                    = 3.1;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: three sensors of type 4
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  Double_t shift6              = gkChainGapY + 2. * box4->GetDY();
-  TGeoTranslation* transD6     = new TGeoTranslation("td", 0., -1. * shift6, 0.);
-  TGeoTranslation* transU6     = new TGeoTranslation("tu", 0., shift6, 0.);
-  sector06->AddNode(sensor04, 1, transD6);
-  sector06->AddNode(sensor04, 2);
-  sector06->AddNode(sensor04, 3, transU6);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 5
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor05, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 8: single sensor of type 6
-  TGeoVolumeAssembly* sector08 = new TGeoVolumeAssembly("Sector08");
-  sector08->AddNode(sensor06, 1);
-  sector08->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder01", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18 x-mirror of 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  //  nSectors       = 5;
-  //  sectorTypes[0] = 1;
-  //  sectorTypes[1] = 2;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  //  s0name = Form("Sector%02d", sectorTypes[0]);
-  //  s0vol  = gGeoMan->GetVolume(s0name);
-  //  shape  = (TGeoBBox*) s0vol->GetShape();
-  //  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'l');  // mirrored
-  //  ConstructLadder("Ladder18", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 2 2 2 3 4 4
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder02d", 0, sectorTypes, 'r');
-  //  ConstructLadder("Ladder02", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03: 10 sectors, type 4 4 3 2 2 3 4 4
-  nSectors       = 4;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder03", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder04", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder05", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19 x-mirror of 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  //  nSectors       = 5;
-  //  sectorTypes[0] = 7;
-  //  sectorTypes[1] = 3;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 5;
-  //  s0name = Form("Sector%02d", sectorTypes[0]);
-  //  s0vol  = gGeoMan->GetVolume(s0name);
-  //  shape  = (TGeoBBox*) s0vol->GetShape();
-  //  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'l');  // mirrored
-  //  ConstructLadder("Ladder19", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder06", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder07", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(7, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 6 sensors, type 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder08", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(8, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 10 sectors, type 5 4 4 5
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder09", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 8;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder10", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 20 x-mirror of 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  //  nSectors       = 5;
-  //  sectorTypes[0] = 8;
-  //  sectorTypes[1] = 3;
-  //  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 5;
-  //  sectorTypes[4] = 5;
-  //  s0vol  = gGeoMan->GetVolume(s0name);
-  //  shape  = (TGeoBBox*) s0vol->GetShape();
-  //  ladderY = 2. * shape->GetDY();
-  halfLadderU = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'l');  // mirrored
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder20", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder11", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder12", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder13", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder14", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap, same height as Ladder 05
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  //  ConstructLadderWithGap("Ladder15", halfLadderU, halfLadderD, 2*gapY);
-  ConstructLadderWithGap(15, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder16", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder17", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-// TGeoVolume* ConstructLadder(const char* name,
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  TString name;
-  name = Form("Ladder%02d", LadderIndex);
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) {
-    if (LadderIndex == 5 || LadderIndex == 10 || LadderIndex == 19 || LadderIndex == 20 || LadderIndex == 15) {
-      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) / 2 - 1;
-      TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., YnumOfFrameBoxes * gkFrameStep / 2.,
-                                            (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-      TGeoVolume* sliceVol =
-        fullFrameBoxVol->Divide(name + "_FullFrameBox_slice", 2, -YnumOfFrameBoxes * gkFrameStep / 2., 0., gkFrameStep);
-
-      ConstructFrameBox("FrameBox", sliceVol, xu / 2.);
-      TGeoRotation* fullFrameRot = new TGeoRotation(name + "_FullFrameBox_rot", 90., 180., -90.);
-      ladder->AddNode(
-        fullFrameBoxVol, 1,
-        new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., (2. + (Double_t) YnumOfFrameBoxes / 2.) * gkFrameStep,
-                           -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2., fullFrameRot));
-      ladder->AddNode(
-        fullFrameBoxVol, 2,
-        new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., -(2. + (Double_t) YnumOfFrameBoxes / 2.) * gkFrameStep,
-                           -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2., fullFrameRot));
-      ladder->GetShape()->ComputeBBox();
-    }
-    else if (LadderIndex == 1 || LadderIndex == 18) {
-      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) / 2 - 1;
-      TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., YnumOfFrameBoxes * gkFrameStep / 2.,
-                                            (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-      TGeoVolume* sliceVol =
-        fullFrameBoxVol->Divide(name + "_FullFrameBox_slice", 2, -YnumOfFrameBoxes * gkFrameStep / 2., 0., gkFrameStep);
-
-      ConstructFrameBox("FrameBox", sliceVol, xu / 2.);
-      TGeoRotation* fullFrameRot = new TGeoRotation(name + "_FullFrameBox_rot", 90., 180., -90.);
-      ladder->AddNode(
-        fullFrameBoxVol, 1,
-        new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., (2. + (Double_t) YnumOfFrameBoxes / 2.) * gkFrameStep,
-                           -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2., fullFrameRot));
-      ladder->AddNode(
-        fullFrameBoxVol, 2,
-        new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., -(2. + (Double_t) YnumOfFrameBoxes / 2.) * gkFrameStep,
-                           -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2., fullFrameRot));
-      ladder->GetShape()->ComputeBBox();
-    }
-    else {
-      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;
-      TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., YnumOfFrameBoxes * gkFrameStep / 2.,
-                                            (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-      TGeoVolume* sliceVol =
-        fullFrameBoxVol->Divide(name + "_FullFrameBox_slice", 2, -YnumOfFrameBoxes * gkFrameStep / 2., 0., gkFrameStep);
-
-      ConstructFrameBox("FrameBox", sliceVol, xu / 2.);
-      TGeoRotation* fullFrameRot = new TGeoRotation(name + "_FullFrameBox_rot", 90., 180., -90.);
-      ladder->AddNode(fullFrameBoxVol, 1,
-                      new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., 0.,
-                                         -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                         fullFrameRot));
-      ladder->GetShape()->ComputeBBox();
-    }
-  }
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-// TGeoVolume* ConstructLadderWithGap(const char* name,
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  TString name;
-  name = Form("Ladder%02d", LadderIndex);
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) {
-    if (LadderIndex != 1 && LadderIndex != 5 && LadderIndex != 10 && LadderIndex != 18 && LadderIndex != 19
-        && LadderIndex != 20 && LadderIndex != 15) {
-      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;
-      TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., YnumOfFrameBoxes * gkFrameStep / 2.,
-                                            (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-      TGeoVolume* sliceVol =
-        fullFrameBoxVol->Divide(name + "_FullFrameBox_slice", 2, -YnumOfFrameBoxes * gkFrameStep / 2., 0., gkFrameStep);
-
-      ConstructFrameBox("FrameBox", sliceVol, xu / 2.);
-      TGeoRotation* fullFrameRot = new TGeoRotation(name + "_FullFrameBox_rot", 90., 180., -90.);
-      ladder->AddNode(fullFrameBoxVol, 1,
-                      new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., 0.,
-                                         -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                         fullFrameRot));
-      ladder->GetShape()->ComputeBBox();
-    }
-    else {
-      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) / 2 - 2;
-      TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., YnumOfFrameBoxes * gkFrameStep / 2.,
-                                            (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-      TGeoVolume* sliceVol =
-        fullFrameBoxVol->Divide(name + "_FullFrameBox_slice", 2, -YnumOfFrameBoxes * gkFrameStep / 2., 0., gkFrameStep);
-
-      ConstructFrameBox("FrameBox", sliceVol, xu / 2.);
-      TGeoRotation* fullFrameRot = new TGeoRotation(name + "_FullFrameBox_rot", 90., 180., -90.);
-      ladder->AddNode(
-        fullFrameBoxVol, 1,
-        new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., (2. + (Double_t) YnumOfFrameBoxes / 2.) * gkFrameStep,
-                           -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2., fullFrameRot));
-      ladder->AddNode(
-        fullFrameBoxVol, 2,
-        new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., -(2. + (Double_t) YnumOfFrameBoxes / 2.) * gkFrameStep,
-                           -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2., fullFrameRot));
-      ladder->GetShape()->ComputeBBox();
-    }
-  }
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  //  cout << "statZ/2.: " << statZ/2. << endl;
-  statZ             = 2 * 3.6;  // changed Z size of the station for cone
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  TString tubName(name);
-  tubName += "_tub";
-  TString expression = boxName + "-" + tubName;
-  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole,
-                                   statZ / 2. + .1);  // .1 opens the hole in z direction
-
-  statShape           = new TGeoCompositeShape(name, expression.Data());
-  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  Double_t xPos = -0.5 * statX;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames) subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    if (iStation % 2 == 0)  // flip ladders for even stations to reproduce CAD layout
-    // even station 0,2,4,6
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ() - subtractedVal / 2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - shape->GetDZ();
-        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ() - subtractedVal / 2.);
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - shape->GetDZ();
-        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ() - subtractedVal / 2.);
-      }
-      // --- Rotated ladders
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ() - subtractedVal / 2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameBox(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  TGeoBBox* frameVertPillarShp   = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep / 2., t);
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-  frameBoxVol->AddNode(frameVertPillarVol, 1,
-                       new TGeoTranslation(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2.));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoTranslation(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2.));
-  TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* A2     = new TGeoConeSeg("A2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                    6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* M2 = new TGeoCombiTrans("M2");
-  M2->RotateX(45.);
-  M2->SetDy(-5.575 + thickness * sqrt(2.));
-  M2->SetDz(6.935);
-  M2->RegisterYourself();
-
-  TGeoShape* coneShp2  = new TGeoCompositeShape("Cone2_shp", "A2-B:M2");
-  TGeoVolume* coneVol2 = new TGeoVolume("Cone2", coneShp2, gStsMedium);
-  coneVol2->SetLineColor(kGreen);
-  //	coneVol2->RegisterYourself();
-
-  coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18d.C b/macro/mcbm/geometry/sts/create_stsgeo_v18d.C
deleted file mode 100644
index d39564c33b..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18d.C
+++ /dev/null
@@ -1,2150 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v13x.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18d: 2 stations of 4x4 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 4x4 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** @date 25.07.2014
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** modify cutout in STS keeping volume to fit beampipes v14e,f,g,h,i,j
- **
- ** v13z: derived from v13y with carbon ladders from v13e included - orientation matches CAD design
- ** v13y: derived from v13x with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences between v13x and v13d:
-// Increased radius of cutout for the beam pipe in the station volumes.
-// The values are now adapted to the actual aperture of the station.
-// Changed cutout for the beam pipe in the STS volume to follow the new
-// beam pipe design v14. The cutout is now a TGeoPcon instead of a TGeoCone.
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTrd2.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.24;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 0.00;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;
-const Bool_t gkConstructFrames      = kTRUE;  // kFALSE;
-const Bool_t gkConstructSmallFrames = kTRUE;  // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.;
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-Double_t BeamPipeRadius(Double_t z);
-TGeoVolume* ConstructCone(Double_t coneDz);
-TGeoVolume* ConstructFrameBox(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18d(const char* geoTag = "v18d")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18d.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  CbmStsSensorFactory* sensFac = CbmStsSensorFactory::Instance();
-  Int_t nSensors               = sensFac->GetNofSensors();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoVolume* sensor = sensFac->GetSensor(iSensor);
-    CheckVolume(sensor, infoFile);
-  }
-
-
-  /*
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name = Form("Sensor%02d",iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1)
-      sensor->SetLineColor(kYellow);
-    if (iSensor == 2)
-      sensor->SetLineColor(kRed);
-    if (iSensor == 3)
-      sensor->SetLineColor(kGreen);
-    if (iSensor == 4)
-      sensor->SetLineColor(kBlue);
-    if (iSensor == 5)
-      sensor->SetLineColor(kYellow);
-    if (iSensor == 6)
-      sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  TString name   = "";
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    name               = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    TString name       = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz       = 1.64;
-  TGeoVolume* coneVolum = ConstructCone(coneDz);
-  if (!coneVolum) Fatal("ConstructCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Int_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 40.};
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 1.83;
-  nLadders       = 3;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  //  ladderTypes[3] = 18;  // 1;
-  //  ladderTypes[4] = 18;  // 1;
-  //  ladderTypes[5] = 2;
-  //  ladderTypes[6] = 2;
-  //  ladderTypes[7] = 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    TGeoRotation* coneRot11      = new TGeoRotation(name + "coneRot1", +90., 0., 0.);
-    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.3, coneRot11);
-    station01->AddNode(coneVolum, 1, conePosRot11);
-
-    TGeoRotation* coneRot12      = new TGeoRotation(name + "coneRot2", +90., 180., 0.);
-    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.3, coneRot12);
-    station01->AddNode(coneVolum, 2, conePosRot12);
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 1.83;
-  nLadders       = 3;
-  ladderTypes[0] = 2;
-  ladderTypes[1] = 2;
-  ladderTypes[2] = 2;
-  //  ladderTypes[3]  = 2;
-  //  ladderTypes[4]  = 2;
-  //  ladderTypes[5]  = 1;
-  //  ladderTypes[6]  = 1;
-  //  ladderTypes[7]  = 2;
-  //  ladderTypes[8]  = 2;
-  //  ladderTypes[9]  = 3;
-  //  ladderTypes[10] = 3;
-  //  ladderTypes[11] = 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    TGeoRotation* coneRot21      = new TGeoRotation(name + "coneRot1", -90., 0., 0.);
-    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.3, coneRot21);
-    station02->AddNode(coneVolum, 1, conePosRot21);
-
-    TGeoRotation* coneRot22      = new TGeoRotation(name + "coneRot2", -90., 180., 0.);
-    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.3, coneRot22);
-    station02->AddNode(coneVolum, 2, conePosRot22);
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.74;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 8;
-  //  ladderTypes[1]  = 7;
-  //  ladderTypes[2]  = 6;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 19;  // 5;
-  //  ladderTypes[6]  = 19;  // 5;
-  //  ladderTypes[7]  = 6;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 7;
-  //  ladderTypes[11] = 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot31 = new TGeoRotation (name+"coneRot1", +90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot31);
-  //    station03->AddNode(coneVolum, 1, conePosRot31);
-  //
-  //    TGeoRotation* coneRot32 = new TGeoRotation (name+"coneRot2", +90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot32);
-  //    station03->AddNode(coneVolum, 2, conePosRot32);
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.74;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 9;
-  //  ladderTypes[1]  = 8;
-  //  ladderTypes[2]  = 7;
-  //  ladderTypes[3]  = 6;
-  //  ladderTypes[4]  = 6;
-  //  ladderTypes[5]  = 6;
-  //  ladderTypes[6]  = 5;
-  //  ladderTypes[7]  = 5;
-  //  ladderTypes[8]  = 6;
-  //  ladderTypes[9]  = 6;
-  //  ladderTypes[10] = 6;
-  //  ladderTypes[11] = 7;
-  //  ladderTypes[12] = 8;
-  //  ladderTypes[13] = 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot41 = new TGeoRotation (name+"coneRot1", -90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot41);
-  //    station04->AddNode(coneVolum, 1, conePosRot41);
-  //
-  //    TGeoRotation* coneRot42 = new TGeoRotation (name+"coneRot2", -90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot42);
-  //    station04->AddNode(coneVolum, 2, conePosRot42);
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.73;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 20;  // 10;
-  //  ladderTypes[7]  = 20;  // 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot51 = new TGeoRotation (name+"coneRot1", +90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot51);
-  //    station05->AddNode(coneVolum, 1, conePosRot51);
-  //
-  //    TGeoRotation* coneRot52 = new TGeoRotation (name+"coneRot2", +90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot52);
-  //    station05->AddNode(coneVolum, 2, conePosRot52);
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  // --- same as station 05
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.73;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 12;
-  //  ladderTypes[3]  = 12;
-  //  ladderTypes[4]  = 11;
-  //  ladderTypes[5]  = 11;
-  //  ladderTypes[6]  = 10;
-  //  ladderTypes[7]  = 10;
-  //  ladderTypes[8]  = 11;
-  //  ladderTypes[9]  = 11;
-  //  ladderTypes[10] = 12;
-  //  ladderTypes[11] = 12;
-  //  ladderTypes[12] = 13;
-  //  ladderTypes[13] = 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot61 = new TGeoRotation (name+"coneRot1", -90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot61);
-  //    station06->AddNode(coneVolum, 1, conePosRot61);
-  //
-  //    TGeoRotation* coneRot62 = new TGeoRotation (name+"coneRot2", -90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot62);
-  //    station06->AddNode(coneVolum, 2, conePosRot62);
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.20; // 4.39;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 17;
-  //  ladderTypes[3]  = 17;
-  //  ladderTypes[4]  = 16;
-  //  ladderTypes[5]  = 16;
-  //  ladderTypes[6]  = 16;
-  //  ladderTypes[7]  = 15;
-  //  ladderTypes[8]  = 15;
-  //  ladderTypes[9]  = 16;
-  //  ladderTypes[10] = 16;
-  //  ladderTypes[11] = 16;
-  //  ladderTypes[12] = 17;
-  //  ladderTypes[13] = 17;
-  //  ladderTypes[14] = 13;
-  //  ladderTypes[15] = 14;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot71 = new TGeoRotation (name+"coneRot1", +90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot71);
-  //    station07->AddNode(coneVolum, 1, conePosRot71);
-  //
-  //    TGeoRotation* coneRot72 = new TGeoRotation (name+"coneRot2", +90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot72);
-  //    station07->AddNode(coneVolum, 2, conePosRot72);
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  // --- same as station 07
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.20; // 4.39;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 14;
-  //  ladderTypes[1]  = 13;
-  //  ladderTypes[2]  = 17;
-  //  ladderTypes[3]  = 17;
-  //  ladderTypes[4]  = 16;
-  //  ladderTypes[5]  = 16;
-  //  ladderTypes[6]  = 16;
-  //  ladderTypes[7]  = 15;
-  //  ladderTypes[8]  = 15;
-  //  ladderTypes[9]  = 16;
-  //  ladderTypes[10] = 16;
-  //  ladderTypes[11] = 16;
-  //  ladderTypes[12] = 17;
-  //  ladderTypes[13] = 17;
-  //  ladderTypes[14] = 13;
-  //  ladderTypes[15] = 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    TGeoRotation* coneRot81 = new TGeoRotation (name+"coneRot1", -90., 0., 0.);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3, coneRot81);
-  //    station08->AddNode(coneVolum, 1, conePosRot81);
-  //
-  //    TGeoRotation* coneRot82 = new TGeoRotation (name+"coneRot2", -90., 180., 0.);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3, coneRot82);
-  //    station08->AddNode(coneVolum, 2, conePosRot82);
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[7] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[7] + statPos[0]);
-
-  // --- Create box  around the stations
-  new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  // --- Create cone hosting the beam pipe
-  // --- One straight section with constant radius followed by a cone
-  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  Double_t z2 = gkPipeZ2;
-  Double_t z3 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  Double_t r1 = BeamPipeRadius(z1);
-  Double_t r2 = BeamPipeRadius(z2);
-  Double_t r3 = BeamPipeRadius(z3);
-  r1 += 0.01;  // safety margin
-  r2 += 0.01;  // safety margin
-  r3 += 0.01;  // safety margin
-  cout << z1 << "  " << r1 << endl;
-  cout << z2 << "  " << r2 << endl;
-  cout << z3 << "  " << r3 << endl;
-  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  cutout->DefineSection(0, z1, 0., r1);
-  //  cutout->DefineSection(1, z2, 0., r2);
-  //  cutout->DefineSection(2, z3, 0., r3);
-  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2 - z1) / 2.);
-  TGeoTranslation* trans1 = new TGeoTranslation("trans1", 0., 0., -(z3 - z1) / 2. + (z2 - z1) / 2.);
-  trans1->RegisterYourself();
-  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3 - z2) / 2.);
-  TGeoTranslation* trans2 = new TGeoTranslation("trans2", 0., 0., +(z3 - z1) / 2. - (z3 - z2) / 2.);
-  trans2->RegisterYourself();
-
-  // --- Create STS volume
-  TString stsName = "sts_";
-  stsName += geoTag;
-  TGeoShape* stsShape = new TGeoCompositeShape("stsShape", "stsBox-stsCone1:trans1-stsCone2:trans2");
-  TGeoVolume* sts     = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  top->Export(geoFileName_);
-
-  top->Draw("ogl");
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4.0 cm x 2.2 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.1992;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.1992;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.1992;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 3.1 cm)
-  xSize                    = 3.1;
-  ySize                    = 3.1;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: three sensors of type 4
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  Double_t shift6              = gkChainGapY + 2. * box4->GetDY();
-  TGeoTranslation* transD6     = new TGeoTranslation("td", 0., -1. * shift6, 0.);
-  TGeoTranslation* transU6     = new TGeoTranslation("tu", 0., shift6, 0.);
-  sector06->AddNode(sensor04, 1, transD6);
-  sector06->AddNode(sensor04, 2);
-  sector06->AddNode(sensor04, 3, transU6);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 5
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor05, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 8: single sensor of type 6
-  TGeoVolumeAssembly* sector08 = new TGeoVolumeAssembly("Sector08");
-  sector08->AddNode(sensor06, 1);
-  sector08->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder01", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18 x-mirror of 01: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  //  nSectors       = 5;
-  //  sectorTypes[0] = 1;
-  //  sectorTypes[1] = 2;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  //  s0name = Form("Sector%02d", sectorTypes[0]);
-  //  s0vol  = gGeoMan->GetVolume(s0name);
-  //  shape  = (TGeoBBox*) s0vol->GetShape();
-  //  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'l');  // mirrored
-  //  ConstructLadder("Ladder18", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 2 2 2 3 4 4
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder02d", 0, sectorTypes, 'r');
-  //  ConstructLadder("Ladder02", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03: 10 sectors, type 4 4 3 2 2 3 4 4
-  nSectors       = 4;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder03", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder04", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder05", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19 x-mirror of 05: 10 sectors, type 5 4 3 3 7 7 3 3 4 5
-  //  nSectors       = 5;
-  //  sectorTypes[0] = 7;
-  //  sectorTypes[1] = 3;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 5;
-  //  s0name = Form("Sector%02d", sectorTypes[0]);
-  //  s0vol  = gGeoMan->GetVolume(s0name);
-  //  shape  = (TGeoBBox*) s0vol->GetShape();
-  //  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'l');  // mirrored
-  //  ConstructLadder("Ladder19", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder06", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  //  ConstructLadder("Ladder07", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(7, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 6 sensors, type 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder08", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(8, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 10 sectors, type 5 4 4 5
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder09", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 8;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder10", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 20 x-mirror of 10: 10 sectors, type 5 5 4 3 8 8 3 4 5 5
-  //  nSectors       = 5;
-  //  sectorTypes[0] = 8;
-  //  sectorTypes[1] = 3;
-  //  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 5;
-  //  sectorTypes[4] = 5;
-  //  s0vol  = gGeoMan->GetVolume(s0name);
-  //  shape  = (TGeoBBox*) s0vol->GetShape();
-  //  ladderY = 2. * shape->GetDY();
-  halfLadderU = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'l');  // mirrored
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder20", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder11", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder12", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder13", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder14", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap, same height as Ladder 05
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  //  ConstructLadderWithGap("Ladder15", halfLadderU, halfLadderD, 2*gapY);
-  ConstructLadderWithGap(15, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder16", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  //  ConstructLadder("Ladder17", halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-// TGeoVolume* ConstructLadder(const char* name,
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  TString name;
-  name = Form("Ladder%02d", LadderIndex);
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) {
-    //    if (LadderIndex == 5 || LadderIndex == 10 || LadderIndex == 19 || LadderIndex == 20 || LadderIndex == 15) {
-    //      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep)/2-1;
-    //      TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., YnumOfFrameBoxes*gkFrameStep/2., (xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-    //      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name+"_FullFrameBox", fullFrameShp, gStsMedium);
-    //      TGeoVolume* sliceVol = fullFrameBoxVol->Divide(name+"_FullFrameBox_slice", 2, -YnumOfFrameBoxes*gkFrameStep/2., 0., gkFrameStep);
-    //
-    //      ConstructFrameBox("FrameBox", sliceVol, xu/2.);
-    //      TGeoRotation* fullFrameRot = new TGeoRotation (name+"_FullFrameBox_rot", 90., 180., -90.);
-    //      ladder->AddNode(fullFrameBoxVol, 1, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., (2.+(Double_t)YnumOfFrameBoxes/2.)*gkFrameStep, -ladderZ/2.-(xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-    //      ladder->AddNode(fullFrameBoxVol, 2, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., -(2.+(Double_t)YnumOfFrameBoxes/2.)*gkFrameStep, -ladderZ/2.-(xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-    //      ladder->GetShape()->ComputeBBox();
-    //
-    //    } else if (LadderIndex == 1 || LadderIndex == 18) {
-    //      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep)/2-1;
-    //      TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., YnumOfFrameBoxes*gkFrameStep/2., (xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-    //      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name+"_FullFrameBox", fullFrameShp, gStsMedium);
-    //      TGeoVolume* sliceVol = fullFrameBoxVol->Divide(name+"_FullFrameBox_slice", 2, -YnumOfFrameBoxes*gkFrameStep/2., 0., gkFrameStep);
-    //
-    //      ConstructFrameBox("FrameBox", sliceVol, xu/2.);
-    //      TGeoRotation* fullFrameRot = new TGeoRotation (name+"_FullFrameBox_rot", 90., 180., -90.);
-    //      ladder->AddNode(fullFrameBoxVol, 1, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., (2.+(Double_t)YnumOfFrameBoxes/2.)*gkFrameStep, -ladderZ/2.-(xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-    //      ladder->AddNode(fullFrameBoxVol, 2, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., -(2.+(Double_t)YnumOfFrameBoxes/2.)*gkFrameStep, -ladderZ/2.-(xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-    //      ladder->GetShape()->ComputeBBox();
-    //
-    //    } else {
-    Int_t YnumOfFrameBoxes      = (Int_t)(ladderY / gkFrameStep) + 1;
-    TGeoBBox* fullFrameShp      = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., YnumOfFrameBoxes * gkFrameStep / 2.,
-                                          (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-    TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-    //      TGeoVolume* sliceVol = fullFrameBoxVol->Divide(name+"_FullFrameBox_slice", 2, -YnumOfFrameBoxes*gkFrameStep/2., 0., gkFrameStep);
-    //      ConstructFrameBox("FrameBox", sliceVol, xu/2.);
-    ConstructFrameBox("FrameBox", fullFrameBoxVol, xu / 2.);
-
-    TGeoRotation* fullFrameRot = new TGeoRotation;
-    fullFrameRot->RotateY(180);
-    ladder->AddNode(fullFrameBoxVol, 1,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., 2 * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    ladder->AddNode(fullFrameBoxVol, 2,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., 1 * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    ladder->AddNode(fullFrameBoxVol, 3,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., 0 * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    ladder->AddNode(fullFrameBoxVol, 4,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., -1 * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    ladder->AddNode(fullFrameBoxVol, 5,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., -2 * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    ladder->GetShape()->ComputeBBox();
-    //    }
-  }
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-// TGeoVolume* ConstructLadderWithGap(const char* name,
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  TString name;
-  name = Form("Ladder%02d", LadderIndex);
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-  ladder->GetShape()->ComputeBBox();
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) {
-    //    if (LadderIndex != 1 && LadderIndex != 5 && LadderIndex != 10 && LadderIndex != 18 && LadderIndex != 19 && LadderIndex != 20 && LadderIndex != 15 ) {
-    //      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep)+1;
-    //      TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., YnumOfFrameBoxes*gkFrameStep/2., (xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-    //      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name+"_FullFrameBox", fullFrameShp, gStsMedium);
-    //      TGeoVolume* sliceVol = fullFrameBoxVol->Divide(name+"_FullFrameBox_slice", 2, -YnumOfFrameBoxes*gkFrameStep/2., 0., gkFrameStep);
-    //
-    //      ConstructFrameBox("FrameBox", sliceVol, xu/2.);
-    //      TGeoRotation* fullFrameRot = new TGeoRotation (name+"_FullFrameBox_rot", 90., 180., -90.);
-    //      ladder->AddNode(fullFrameBoxVol, 1, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., 0., -ladderZ/2.-(xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-    //      ladder->GetShape()->ComputeBBox();
-    //
-    //    } else {
-    //      Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep)/2-2;
-    //      TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., YnumOfFrameBoxes*gkFrameStep/2., (xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-    //      TGeoVolume* fullFrameBoxVol = new TGeoVolume(name+"_FullFrameBox", fullFrameShp, gStsMedium);
-    //      TGeoVolume* sliceVol = fullFrameBoxVol->Divide(name+"_FullFrameBox_slice", 2, -YnumOfFrameBoxes*gkFrameStep/2., 0., gkFrameStep);
-    //
-    //      ConstructFrameBox("FrameBox", sliceVol, xu/2.);
-    //      ConstructFrameBox("FrameBox", fullFrameBoxVol, xu/2.);
-    //      TGeoRotation* fullFrameRot = new TGeoRotation (name+"_FullFrameBox_rot", 90., 180., -90.);
-    //      ladder->AddNode(fullFrameBoxVol, 1, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., (2.+(Double_t)YnumOfFrameBoxes/2.)*gkFrameStep, -ladderZ/2.-(xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-    //      ladder->AddNode(fullFrameBoxVol, 2, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., -(2.+(Double_t)YnumOfFrameBoxes/2.)*gkFrameStep, -ladderZ/2.-(xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-    //      ladder->GetShape()->ComputeBBox();
-    //
-    //    }
-  }
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  //  cout << "statZ/2.: " << statZ/2. << endl;
-  statZ             = 2 * 3.6;  // changed Z size of the station for cone
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  TString tubName(name);
-  tubName += "_tub";
-  TString expression = boxName + "-" + tubName;
-  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole,
-                                   statZ / 2. + .1);  // .1 opens the hole in z direction
-
-  statShape           = new TGeoCompositeShape(name, expression.Data());
-  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  Double_t xPos = -0.5 * statX;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames) subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    if (iStation % 2 == 0)  // flip ladders for even stations to reproduce CAD layout
-    // even station 0,2,4,6
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ() - subtractedVal / 2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - shape->GetDZ();
-        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ() - subtractedVal / 2.);
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - shape->GetDZ();
-        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ() - subtractedVal / 2.);
-      }
-      // --- Rotated ladders
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + shape->GetDZ();
-        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ() - subtractedVal / 2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameBox(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  TGeoBBox* frameVertPillarShp   = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep / 2., t);
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-  frameBoxVol->AddNode(frameVertPillarVol, 1,
-                       new TGeoTranslation(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2.));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoTranslation(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2.));
-  TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* A2     = new TGeoConeSeg("A2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                    6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* M2 = new TGeoCombiTrans("M2");
-  M2->RotateX(45.);
-  M2->SetDy(-5.575 + thickness * sqrt(2.));
-  M2->SetDz(6.935);
-  M2->RegisterYourself();
-
-  TGeoShape* coneShp2  = new TGeoCompositeShape("Cone2_shp", "A2-B:M2");
-  TGeoVolume* coneVol2 = new TGeoVolume("Cone2", coneShp2, gStsMedium);
-  coneVol2->SetLineColor(kGreen);
-  //	coneVol2->RegisterYourself();
-
-  coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18e.C b/macro/mcbm/geometry/sts/create_stsgeo_v18e.C
deleted file mode 100644
index 5200ada7e0..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18e.C
+++ /dev/null
@@ -1,2354 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18e.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18e(const char* geoTag = "v18e")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18e.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 10;
-  ladderTypes[1] = 10;
-  ladderTypes[2] = 10;
-  //  ladderTypes[3]  =  9;  // 12;  // 2;
-  //  ladderTypes[4]  =  9;  // 12;  // 2;
-  //  ladderTypes[5]  =  2;  // 21;  // 1;
-  //  ladderTypes[6]  =  2;  // 21;  // 1;
-  //  ladderTypes[7]  =  9;  // 12;  // 2;
-  //  ladderTypes[8]  =  9;  // 12;  // 2;
-  //  ladderTypes[9]  = 10;  // 13;  // 3;
-  //  ladderTypes[10] = 10;  // 13;  // 3;
-  //  ladderTypes[11] = 11;  // 22;  // 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 10 sectors, type 4 4 3 2 2 2 2 3 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 10 sectors, type 4 3 3 2 2 2 2 3 3 4
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    if (iStation % 2 == 0)  // flip ladders for even stations to reproduce CAD layout
-    // even station 0,2,4,6
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18f.C b/macro/mcbm/geometry/sts/create_stsgeo_v18f.C
deleted file mode 100644
index 69b08c4e25..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18f.C
+++ /dev/null
@@ -1,2363 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18f.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18f(const char* geoTag = "v18f_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18f.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 10;
-  ladderTypes[1] = 10;
-  ladderTypes[2] = 10;
-  //  ladderTypes[3]  =  9;  // 12;  // 2;
-  //  ladderTypes[4]  =  9;  // 12;  // 2;
-  //  ladderTypes[5]  =  2;  // 21;  // 1;
-  //  ladderTypes[6]  =  2;  // 21;  // 1;
-  //  ladderTypes[7]  =  9;  // 12;  // 2;
-  //  ladderTypes[8]  =  9;  // 12;  // 2;
-  //  ladderTypes[9]  = 10;  // 13;  // 3;
-  //  ladderTypes[10] = 10;  // 13;  // 3;
-  //  ladderTypes[11] = 11;  // 22;  // 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18g.C b/macro/mcbm/geometry/sts/create_stsgeo_v18g.C
deleted file mode 100644
index f8c40690d1..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18g.C
+++ /dev/null
@@ -1,2365 +0,0 @@
-/* Copyright (C) 2012-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18g.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18g(const char* geoTag = "v18g_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18g.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 10;
-  ladderTypes[1] = 10;
-  ladderTypes[2] = 10;
-  //  ladderTypes[3]  =  9;  // 12;  // 2;
-  //  ladderTypes[4]  =  9;  // 12;  // 2;
-  //  ladderTypes[5]  =  2;  // 21;  // 1;
-  //  ladderTypes[6]  =  2;  // 21;  // 1;
-  //  ladderTypes[7]  =  9;  // 12;  // 2;
-  //  ladderTypes[8]  =  9;  // 12;  // 2;
-  //  ladderTypes[9]  = 10;  // 13;  // 3;
-  //  ladderTypes[10] = 10;  // 13;  // 3;
-  //  ladderTypes[11] = 11;  // 22;  // 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18h.C b/macro/mcbm/geometry/sts/create_stsgeo_v18h.C
deleted file mode 100644
index fc0b81dfcd..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18h.C
+++ /dev/null
@@ -1,2423 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18h.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18h: implement Sensors as VolumeAssembly of active and inactive parts
- ** v18g: add inactive guard ring around active silicon sensor
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18h(const char* geoTag = "v18h_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18h.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon (active)
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> silicon (inactive)
-  FairGeoMedium* mSilicon_inactive = geoMedia->getMedium("silicon_inactive");
-  if (!mSilicon_inactive) Fatal("Main", "FairMedium silicon_inactive not found");
-  geoBuild->createMedium(mSilicon_inactive);
-  TGeoMedium* silicon_inactive = gGeoMan->GetMedium("silicon_inactive");
-  if (!silicon_inactive) Fatal("Main", "Medium silicon_inactive not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 10;
-  ladderTypes[1] = 10;
-  ladderTypes[2] = 10;
-  //  ladderTypes[3]  =  9;  // 12;  // 2;
-  //  ladderTypes[4]  =  9;  // 12;  // 2;
-  //  ladderTypes[5]  =  2;  // 21;  // 1;
-  //  ladderTypes[6]  =  2;  // 21;  // 1;
-  //  ladderTypes[7]  =  9;  // 12;  // 2;
-  //  ladderTypes[8]  =  9;  // 12;  // 2;
-  //  ladderTypes[9]  = 10;  // 13;  // 3;
-  //  ladderTypes[10] = 10;  // 13;  // 3;
-  //  ladderTypes[11] = 11;  // 22;  // 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  //  gGeoManager->SetVisLevel(6);
-  gGeoManager->SetVisLevel(7);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  // sizes provided from DXF file by Johann
-  Double_t inactive_ring_xWidth = 0.125;  // width of surrounding ring in cm = 1.25 mm
-  Double_t inactive_ring_yWidth = 0.132;  // width of surrounding ring in cm = 1.32 mm
-
-  Double_t xSize = 0.;
-  Double_t ySize = 0.;
-  Double_t zSize = gkSensorThickness;
-
-  TGeoMedium* silicon          = gGeoMan->GetMedium("silicon");
-  TGeoMedium* inactive_silicon = gGeoMan->GetMedium("silicon_inactive");  // AKA "inactive silicon"
-  //  TGeoMedium* inactive_silicon = gGeoMan->GetMedium("STScable");  // AKA "inactive silicon"
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize = 6.2092;
-  ySize = 6.2;
-
-  TGeoVolumeAssembly* sts_sens04 = new TGeoVolumeAssembly("Sensor04");
-
-  // active sensor area inside inactive rings
-  TGeoBBox* shape_active_sensor04 =
-    new TGeoBBox("active_sensor04", xSize / 2. - inactive_ring_xWidth, ySize / 2. - inactive_ring_yWidth, zSize / 2.);
-  TGeoVolume* sts_active_sens04 = new TGeoVolume("ActiveSensor04", shape_active_sensor04, silicon);
-  sts_sens04->AddNode(sts_active_sens04, 1);
-
-  //  sts_active_sens04->SetLineColor(kRed);
-  sts_active_sens04->SetLineColor(kBlue);
-
-  // entire sensor including inactive rings
-  TGeoBBox* shape_inactive1_sensor04;
-  TGeoVolume* sts_inactive1_sens04;
-  TGeoTranslation* sts_ina_trans1;
-  shape_inactive1_sensor04 = new TGeoBBox("inactive1_sensor04", xSize / 2., inactive_ring_yWidth / 2., zSize / 2.);
-  sts_inactive1_sens04     = new TGeoVolume("Inactive1Sensor04", shape_inactive1_sensor04, inactive_silicon);
-
-  // translations
-  sts_ina_trans1 = new TGeoTranslation("", 0., (ySize - inactive_ring_yWidth) / 2., 0.);
-  sts_sens04->AddNode(sts_inactive1_sens04, 1, sts_ina_trans1);
-
-  sts_ina_trans1 = new TGeoTranslation("", 0., -(ySize - inactive_ring_yWidth) / 2., 0.);
-  sts_sens04->AddNode(sts_inactive1_sens04, 2, sts_ina_trans1);
-
-  //  sts_inactive1_sens04->SetLineColor(kGreen);
-  //  sts_inactive1_sens04->SetLineColor(kBlue);
-  sts_inactive1_sens04->SetLineColor(kRed);
-
-  TGeoBBox* shape_inactive2_sensor04;
-  TGeoVolume* sts_inactive2_sens04;
-  TGeoTranslation* sts_ina_trans2;
-  shape_inactive2_sensor04 =
-    new TGeoBBox("inactive2_sensor04", inactive_ring_xWidth / 2., ySize / 2. - inactive_ring_yWidth, zSize / 2.);
-  sts_inactive2_sens04 = new TGeoVolume("Inactive2Sensor04", shape_inactive2_sensor04, inactive_silicon);
-
-  // translations
-  sts_ina_trans2 = new TGeoTranslation("", (xSize - inactive_ring_xWidth) / 2., 0., 0.);
-  sts_sens04->AddNode(sts_inactive2_sens04, 1, sts_ina_trans2);
-
-  sts_ina_trans2 = new TGeoTranslation("", -(xSize - inactive_ring_xWidth) / 2., 0., 0.);
-  sts_sens04->AddNode(sts_inactive2_sens04, 2, sts_ina_trans2);
-
-  //  sts_inactive2_sens04->SetLineColor(kBlue);
-  sts_inactive2_sens04->SetLineColor(kRed);
-
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18i.C b/macro/mcbm/geometry/sts/create_stsgeo_v18i.C
deleted file mode 100644
index 9d4282518f..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18i.C
+++ /dev/null
@@ -1,2368 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18i.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18i: rotate STS by 90 degrees around z-axis, remove ladders
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18i(const char* geoTag = "v18i_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18i.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 10;
-  ladderTypes[1] = 10;
-  ladderTypes[2] = 10;
-  //  ladderTypes[3]  =  9;  // 12;  // 2;
-  //  ladderTypes[4]  =  9;  // 12;  // 2;
-  //  ladderTypes[5]  =  2;  // 21;  // 1;
-  //  ladderTypes[6]  =  2;  // 21;  // 1;
-  //  ladderTypes[7]  =  9;  // 12;  // 2;
-  //  ladderTypes[8]  =  9;  // 12;  // 2;
-  //  ladderTypes[9]  = 10;  // 13;  // 3;
-  //  ladderTypes[10] = 10;  // 13;  // 3;
-  //  ladderTypes[11] = 11;  // 22;  // 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  //  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-
-  // rotate the STS around z
-  TGeoRotation* sts_rotation = new TGeoRotation();
-  sts_rotation->RotateZ(90);
-  TGeoCombiTrans* stsTrans = new TGeoCombiTrans(0., 0., stsPosZ, sts_rotation);
-
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18j.C b/macro/mcbm/geometry/sts/create_stsgeo_v18j.C
deleted file mode 100644
index ca12a74d8c..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18j.C
+++ /dev/null
@@ -1,2490 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18j.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18j(const char* geoTag = "v18j_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18j.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-
-  //---> STS box
-  FairGeoMedium* mPP = geoMedia->getMedium("polypropylene");
-  if (!mPP) Fatal("Main", "FairMedium polypropylene not found");
-  geoBuild->createMedium(mPP);
-  TGeoMedium* polyp = gGeoMan->GetMedium("polypropylene");
-  if (!polyp) Fatal("Main", "Medium polyp not found");
-
-  FairGeoMedium* mAl = geoMedia->getMedium("aluminium");
-  if (!mPP) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAl);
-  TGeoMedium* alum = gGeoMan->GetMedium("aluminium");
-  if (!alum) Fatal("Main", "Medium alum not found");
-
-  //  TGeoMaterial *matAl = new TGeoMaterial("Al", 26.98,13,2.7);
-  //  TGeoMedium *medAl = new TGeoMedium("aluminium",
-  //				  nMedia++, matAl);
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 10;
-  ladderTypes[1] = 10;
-  ladderTypes[2] = 10;
-  //  ladderTypes[3]  =  9;  // 12;  // 2;
-  //  ladderTypes[4]  =  9;  // 12;  // 2;
-  //  ladderTypes[5]  =  2;  // 21;  // 1;
-  //  ladderTypes[6]  =  2;  // 21;  // 1;
-  //  ladderTypes[7]  =  9;  // 12;  // 2;
-  //  ladderTypes[8]  =  9;  // 12;  // 2;
-  //  ladderTypes[9]  = 10;  // 13;  // 3;
-  //  ladderTypes[10] = 10;  // 13;  // 3;
-  //  ladderTypes[11] = 11;  // 22;  // 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-
-  //----------------- Create hostin box and  simple vertion of c-frame -------------------------
-  //calculated from preliminary drawing of O.Vasylyev
-  dim_x    = 80.0;
-  dim_y    = 110.0;
-  dim_z    = 35.0;
-  dim_wall = 0.3;
-
-  TGeoBBox* ppBox      = new TGeoBBox("ppBox", dim_x, dim_y, dim_z);
-  TGeoVolume* ppbox    = new TGeoVolume("ppbox", ppBox, gStsMedium);
-  TGeoTranslation* tr1 = new TGeoTranslation(-20., 30, -(dim_z / 2. - dim_wall / 2.));
-  TGeoTranslation* tr2 = new TGeoTranslation(-20., 30, dim_z / 2. - dim_wall / 2.);
-
-  TGeoTranslation* tr3 = new TGeoTranslation(-20, dim_y / 2. - dim_wall / 2. + 30, 0.);
-  TGeoTranslation* tr4 = new TGeoTranslation(-20, -(dim_y / 2. - dim_wall / 2.) + 30, 0.);
-
-  TGeoTranslation* tr5 = new TGeoTranslation(-(dim_x / 2. - dim_wall / 2.) - 20., 30., 0.);
-  TGeoTranslation* tr6 = new TGeoTranslation(dim_x / 2. - dim_wall / 2. - 20, 30., 0.);
-
-  TGeoVolume* front = gGeoMan->MakeBox("front", polyp, dim_x / 2., dim_y / 2., dim_wall / 2.);
-  //  TGeoVolume *btop  =  gGeoMan->MakeBox("btop",   polyp, dim_x/2., dim_z/2., dim_wall/2.);
-  TGeoVolume* btop = gGeoMan->MakeBox("btop", polyp, dim_x / 2., dim_wall / 2., dim_z / 2. - dim_wall);
-  TGeoVolume* side = gGeoMan->MakeBox("side", polyp, dim_wall / 2., dim_y / 2. - dim_wall, dim_z / 2. - dim_wall);
-
-
-  TGeoVolume* cFrame1  = new TGeoVolume("cFrame01", ppBox, gStsMedium);
-  TGeoVolume* cooling1 = gGeoMan->MakeBox("cooling", alum, 39. / 2., 17.2 / 2., 1.5 / 2.);
-  TGeoVolume* support1 = gGeoMan->MakeBox("support1", alum, 47. / 2., 7.1 / 2., 1.5 / 2.);
-
-  //calculated from preliminary drawing of O.Vasylyev
-  double shiftY1 = 53.2;
-  double shiftY2 = 67.5;
-  double shiftY3 = -16.5;
-  double shiftX1 = -6.2;
-  double shiftX2 = -34.7;
-  double shiftX3 = -10.2;
-
-  TGeoTranslation* tr70 = new TGeoTranslation(shiftX1, shiftY1, 0.);
-  TGeoTranslation* tr80 = new TGeoTranslation(shiftX2, shiftY2, 0.);
-  TGeoTranslation* tr90 = new TGeoTranslation(shiftX3, shiftY3, 0.);
-  cFrame1->AddNode(cooling1, 7, tr70);
-  cFrame1->AddNode(cooling1, 8, tr80);
-  cFrame1->AddNode(support1, 9, tr90);
-
-  double z0              = -dim_z / 2. + 6.5;  // shift of first cFrame
-  TGeoTranslation* tr_c1 = new TGeoTranslation(0., 0, z0);
-  TGeoTranslation* tr_c2 = new TGeoTranslation(0., 0, z0 + 9);
-
-  TGeoVolume* cFrame2  = new TGeoVolume("cFrame02", ppBox, gStsMedium);
-  TGeoVolume* support2 = gGeoMan->MakeBox("support2", alum, 47. / 2., 4. / 2., 1.5 / 2.);
-  //calculated from preliminary drawing of O.Vasylyev
-  shiftY1               = 49.8;
-  shiftY2               = 64.1;
-  shiftY3               = -17.9;
-  TGeoTranslation* tr8  = new TGeoTranslation(shiftX1, shiftY1, 0.);
-  TGeoTranslation* tr9  = new TGeoTranslation(shiftX2, shiftY2, 0.);
-  TGeoTranslation* tr10 = new TGeoTranslation(shiftX3, shiftY3, 0.);
-  cFrame2->AddNode(cooling1, 7, tr8);
-  cFrame2->AddNode(cooling1, 8, tr9);
-  cFrame2->AddNode(support2, 9, tr10);
-
-  TGeoTranslation* tr_c3 = new TGeoTranslation(0., 0., z0 + 14);
-  TGeoTranslation* tr_c4 = new TGeoTranslation(0., 0., z0 + 23);
-
-  ppbox->AddNode(front, 1, tr1);
-  ppbox->AddNode(front, 2, tr2);
-  ppbox->AddNode(btop, 3, tr3);
-  ppbox->AddNode(btop, 4, tr4);
-  ppbox->AddNode(side, 5, tr5);
-  ppbox->AddNode(side, 6, tr6);
-  ppbox->AddNode(cFrame1, 7, tr_c1);
-  ppbox->AddNode(cFrame1, 8, tr_c2);
-  ppbox->AddNode(cFrame2, 9, tr_c3);
-  ppbox->AddNode(cFrame2, 10, tr_c4);
-
-  cooling1->SetLineColor(kBlue);
-  cooling1->SetTransparency(40);
-
-  support1->SetLineColor(kRed);
-  support1->SetTransparency(20);
-
-  support2->SetLineColor(kOrange);
-  support2->SetTransparency(20);
-
-  front->SetLineColor(kYellow);
-  btop->SetLineColor(kYellow);
-  side->SetLineColor(kYellow);
-  cFrame1->SetLineColor(kYellow);
-  cFrame2->SetLineColor(kYellow);
-
-  front->SetTransparency(30);
-
-  ppbox->GetShape()->ComputeBBox();
-  CheckVolume(ppbox);
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  sts->AddNode(ppbox, 3);
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-  // --- Material polypropylene
-  density            = 0.90;  // [g/cm^3]
-  TGeoMixture* matPP = new TGeoMixture("polypropylene", 2, density);
-  matPP->AddElement(12.01, 6, 0.856);  // C
-  matPP->AddElement(1.01, 1, 0.144);   // H
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-
-  // --- Passive PP box
-  TGeoMedium* medPP = new TGeoMedium("polypropylene", nMedia++, matPP);
-  medPP->SetParam(0, 0.);     // is passive
-  medPP->SetParam(1, 1.);     // is in magnetic field
-  medPP->SetParam(2, 20.);    // max. field [kG]
-  medPP->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  TGeoMaterial* matAl = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* medAl   = new TGeoMedium("aluminium", nMedia++, matAl);
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18k.C b/macro/mcbm/geometry/sts/create_stsgeo_v18k.C
deleted file mode 100644
index 6ccfd4086a..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18k.C
+++ /dev/null
@@ -1,2495 +0,0 @@
-/* Copyright (C) 2012-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18k.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** v18k: add mMVD box to mSTS box
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18k(const char* geoTag = "v18k_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18k.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-
-  //---> STS box
-  FairGeoMedium* mPP = geoMedia->getMedium("polypropylene");
-  if (!mPP) Fatal("Main", "FairMedium polypropylene not found");
-  geoBuild->createMedium(mPP);
-  TGeoMedium* polyp = gGeoMan->GetMedium("polypropylene");
-  if (!polyp) Fatal("Main", "Medium polyp not found");
-
-  FairGeoMedium* mAl = geoMedia->getMedium("aluminium");
-  if (!mPP) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAl);
-  TGeoMedium* alum = gGeoMan->GetMedium("aluminium");
-  if (!alum) Fatal("Main", "Medium alum not found");
-
-  //  TGeoMaterial *matAl = new TGeoMaterial("Al", 26.98,13,2.7);
-  //  TGeoMedium *medAl = new TGeoMedium("aluminium",
-  //				  nMedia++, matAl);
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ          = 40.;
-  rHole          = 2.0;
-  nLadders       = 3;
-  ladderTypes[0] = 10;
-  ladderTypes[1] = 10;
-  ladderTypes[2] = 10;
-  //  ladderTypes[3]  =  9;  // 12;  // 2;
-  //  ladderTypes[4]  =  9;  // 12;  // 2;
-  //  ladderTypes[5]  =  2;  // 21;  // 1;
-  //  ladderTypes[6]  =  2;  // 21;  // 1;
-  //  ladderTypes[7]  =  9;  // 12;  // 2;
-  //  ladderTypes[8]  =  9;  // 12;  // 2;
-  //  ladderTypes[9]  = 10;  // 13;  // 3;
-  //  ladderTypes[10] = 10;  // 13;  // 3;
-  //  ladderTypes[11] = 11;  // 22;  // 4;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-
-  //----------------- Create hostin box and  simple vertion of c-frame -------------------------
-  //calculated from preliminary drawing of O.Vasylyev
-  dim_x    = 80.0;
-  dim_y    = 110.0;
-  dim_z    = 35.0;
-  dim_wall = 0.3;
-
-  TGeoBBox* ppBox      = new TGeoBBox("ppBox", dim_x, dim_y, dim_z);
-  TGeoVolume* ppbox    = new TGeoVolume("ppbox", ppBox, gStsMedium);
-  TGeoTranslation* tr1 = new TGeoTranslation(-20., 30, -(dim_z / 2. - dim_wall / 2.));
-  TGeoTranslation* tr2 = new TGeoTranslation(-20., 30, dim_z / 2. - dim_wall / 2.);
-
-  TGeoTranslation* tr3 = new TGeoTranslation(-20, dim_y / 2. - dim_wall / 2. + 30, 0.);
-  TGeoTranslation* tr4 = new TGeoTranslation(-20, -(dim_y / 2. - dim_wall / 2.) + 30, 0.);
-
-  TGeoTranslation* tr5 = new TGeoTranslation(-(dim_x / 2. - dim_wall / 2.) - 20., 30., 0.);
-  TGeoTranslation* tr6 = new TGeoTranslation(dim_x / 2. - dim_wall / 2. - 20, 30., 0.);
-
-  TGeoVolume* mmvd  = gGeoMan->MakeBox("mmvd", polyp, 25 / 2., 25 / 2., 10 / 2.);
-  TGeoVolume* front = gGeoMan->MakeBox("front", polyp, dim_x / 2., dim_y / 2., dim_wall / 2.);
-  TGeoVolume* btop  = gGeoMan->MakeBox("btop", polyp, dim_x / 2., dim_wall / 2., dim_z / 2. - dim_wall);
-  TGeoVolume* side  = gGeoMan->MakeBox("side", polyp, dim_wall / 2., dim_y / 2. - dim_wall, dim_z / 2. - dim_wall);
-
-
-  TGeoVolume* cFrame1  = new TGeoVolume("cFrame01", ppBox, gStsMedium);
-  TGeoVolume* cooling1 = gGeoMan->MakeBox("cooling", alum, 39. / 2., 17.2 / 2., 1.5 / 2.);
-  TGeoVolume* support1 = gGeoMan->MakeBox("support1", alum, 47. / 2., 7.1 / 2., 1.5 / 2.);
-
-  //calculated from preliminary drawing of O.Vasylyev
-  double shiftY1 = 53.2;
-  double shiftY2 = 67.5;
-  double shiftY3 = -16.5;
-  double shiftX1 = -6.2;
-  double shiftX2 = -34.7;
-  double shiftX3 = -10.2;
-
-  TGeoTranslation* tr70 = new TGeoTranslation(shiftX1, shiftY1, 0.);
-  TGeoTranslation* tr80 = new TGeoTranslation(shiftX2, shiftY2, 0.);
-  TGeoTranslation* tr90 = new TGeoTranslation(shiftX3, shiftY3, 0.);
-  cFrame1->AddNode(cooling1, 7, tr70);
-  cFrame1->AddNode(cooling1, 8, tr80);
-  cFrame1->AddNode(support1, 9, tr90);
-
-  double z0              = -dim_z / 2. + 6.5;  // shift of first cFrame
-  TGeoTranslation* tr_c1 = new TGeoTranslation(0., 0, z0);
-  TGeoTranslation* tr_c2 = new TGeoTranslation(0., 0, z0 + 9);
-
-  TGeoVolume* cFrame2  = new TGeoVolume("cFrame02", ppBox, gStsMedium);
-  TGeoVolume* support2 = gGeoMan->MakeBox("support2", alum, 47. / 2., 4. / 2., 1.5 / 2.);
-  //calculated from preliminary drawing of O.Vasylyev
-  shiftY1               = 49.8;
-  shiftY2               = 64.1;
-  shiftY3               = -17.9;
-  TGeoTranslation* tr8  = new TGeoTranslation(shiftX1, shiftY1, 0.);
-  TGeoTranslation* tr9  = new TGeoTranslation(shiftX2, shiftY2, 0.);
-  TGeoTranslation* tr10 = new TGeoTranslation(shiftX3, shiftY3, 0.);
-  cFrame2->AddNode(cooling1, 7, tr8);
-  cFrame2->AddNode(cooling1, 8, tr9);
-  cFrame2->AddNode(support2, 9, tr10);
-
-  TGeoTranslation* tr_c3 = new TGeoTranslation(0., 0., z0 + 14);
-  TGeoTranslation* tr_c4 = new TGeoTranslation(0., 0., z0 + 23);
-
-  ppbox->AddNode(front, 1, tr1);
-  ppbox->AddNode(front, 2, tr2);
-  ppbox->AddNode(btop, 3, tr3);
-  ppbox->AddNode(btop, 4, tr4);
-  ppbox->AddNode(side, 5, tr5);
-  ppbox->AddNode(side, 6, tr6);
-  ppbox->AddNode(cFrame1, 7, tr_c1);
-  ppbox->AddNode(cFrame1, 8, tr_c2);
-  ppbox->AddNode(cFrame2, 9, tr_c3);
-  ppbox->AddNode(cFrame2, 10, tr_c4);
-
-  TGeoTranslation* tr11 = new TGeoTranslation(0., 0., -(dim_z + 10) / 2.);
-  ppbox->AddNode(mmvd, 11, tr11);
-  mmvd->SetLineColor(kOrange);
-
-  cooling1->SetLineColor(kBlue);
-  cooling1->SetTransparency(40);
-
-  support1->SetLineColor(kRed);
-  support1->SetTransparency(20);
-
-  support2->SetLineColor(kOrange);
-  support2->SetTransparency(20);
-
-  front->SetLineColor(kYellow);
-  btop->SetLineColor(kYellow);
-  side->SetLineColor(kYellow);
-  cFrame1->SetLineColor(kYellow);
-  cFrame2->SetLineColor(kYellow);
-
-  front->SetTransparency(30);
-
-  ppbox->GetShape()->ComputeBBox();
-  CheckVolume(ppbox);
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  sts->AddNode(ppbox, 3);
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-  // --- Material polypropylene
-  density            = 0.90;  // [g/cm^3]
-  TGeoMixture* matPP = new TGeoMixture("polypropylene", 2, density);
-  matPP->AddElement(12.01, 6, 0.856);  // C
-  matPP->AddElement(1.01, 1, 0.144);   // H
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-
-  // --- Passive PP box
-  TGeoMedium* medPP = new TGeoMedium("polypropylene", nMedia++, matPP);
-  medPP->SetParam(0, 0.);     // is passive
-  medPP->SetParam(1, 1.);     // is in magnetic field
-  medPP->SetParam(2, 20.);    // max. field [kG]
-  medPP->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  TGeoMaterial* matAl = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* medAl   = new TGeoMedium("aluminium", nMedia++, matAl);
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18l.C b/macro/mcbm/geometry/sts/create_stsgeo_v18l.C
deleted file mode 100644
index 34480368e9..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18l.C
+++ /dev/null
@@ -1,2364 +0,0 @@
-/* Copyright (C) 2012-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18l.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18l(const char* geoTag = "v18l_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18l.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // 2018   // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  // 2018   cout << endl;
-  // 2018   statZ = 40.;
-  // 2018   rHole = 2.0;
-  // 2018   nLadders = 3;
-  // 2018   ladderTypes[0]  = 10;
-  // 2018   ladderTypes[1]  = 10;
-  // 2018   ladderTypes[2]  = 10;
-  // 2018 //  ladderTypes[3]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[4]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[5]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[6]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[7]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[8]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[9]  = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[10] = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[11] = 11;  // 22;  // 4;
-  // 2018   TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-  // 2018
-  // 2018   if (gkConstructCones) {
-  // 2018     // upstream
-  // 2018     TGeoRotation* coneRot21 = new TGeoRotation;
-  // 2018     coneRot21->RotateZ(-90);
-  // 2018     coneRot21->RotateY(180);
-  // 2018     //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-  // 2018     TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.305-gkLadderGapZ/2., coneRot21);
-  // 2018     station02->AddNode(coneSmallVolum, 1, conePosRot21);
-  // 2018
-  // 2018     // downstream
-  // 2018     TGeoRotation* coneRot22 = new TGeoRotation;
-  // 2018     coneRot22->RotateZ(-90);
-  // 2018     //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-  // 2018     TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.305+gkLadderGapZ/2., coneRot22);
-  // 2018     station02->AddNode(coneSmallVolum, 2, conePosRot22);
-  // 2018
-  // 2018     station02->GetShape()->ComputeBBox();
-  // 2018   }
-  // 2018
-  // 2018   CheckVolume(station02);
-  // 2018   CheckVolume(station02, infoFile);
-  // 2018   infoFile << "Position z = " << statPos[1] << endl;
-  // 2018
-  // 2018
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18m.C b/macro/mcbm/geometry/sts/create_stsgeo_v18m.C
deleted file mode 100644
index 8727f11194..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18m.C
+++ /dev/null
@@ -1,2365 +0,0 @@
-/* Copyright (C) 2012-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18m.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18m(const char* geoTag = "v18m_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18m.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {159., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // 2018   // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  // 2018   cout << endl;
-  // 2018   statZ = 40.;
-  // 2018   rHole = 2.0;
-  // 2018   nLadders = 3;
-  // 2018   ladderTypes[0]  = 10;
-  // 2018   ladderTypes[1]  = 10;
-  // 2018   ladderTypes[2]  = 10;
-  // 2018 //  ladderTypes[3]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[4]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[5]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[6]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[7]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[8]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[9]  = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[10] = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[11] = 11;  // 22;  // 4;
-  // 2018   TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-  // 2018
-  // 2018   if (gkConstructCones) {
-  // 2018     // upstream
-  // 2018     TGeoRotation* coneRot21 = new TGeoRotation;
-  // 2018     coneRot21->RotateZ(-90);
-  // 2018     coneRot21->RotateY(180);
-  // 2018     //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-  // 2018     TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.305-gkLadderGapZ/2., coneRot21);
-  // 2018     station02->AddNode(coneSmallVolum, 1, conePosRot21);
-  // 2018
-  // 2018     // downstream
-  // 2018     TGeoRotation* coneRot22 = new TGeoRotation;
-  // 2018     coneRot22->RotateZ(-90);
-  // 2018     //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-  // 2018     TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.305+gkLadderGapZ/2., coneRot22);
-  // 2018     station02->AddNode(coneSmallVolum, 2, conePosRot22);
-  // 2018
-  // 2018     station02->GetShape()->ComputeBBox();
-  // 2018   }
-  // 2018
-  // 2018   CheckVolume(station02);
-  // 2018   CheckVolume(station02, infoFile);
-  // 2018   infoFile << "Position z = " << statPos[1] << endl;
-  // 2018
-  // 2018
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v18n.C b/macro/mcbm/geometry/sts/create_stsgeo_v18n.C
deleted file mode 100644
index 51333e2231..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v18n.C
+++ /dev/null
@@ -1,2366 +0,0 @@
-/* Copyright (C) 2012-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v18n.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v18n(const char* geoTag = "v18n_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v18n.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // 2018   // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  // 2018   cout << endl;
-  // 2018   statZ = 40.;
-  // 2018   rHole = 2.0;
-  // 2018   nLadders = 3;
-  // 2018   ladderTypes[0]  = 10;
-  // 2018   ladderTypes[1]  = 10;
-  // 2018   ladderTypes[2]  = 10;
-  // 2018 //  ladderTypes[3]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[4]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[5]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[6]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[7]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[8]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[9]  = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[10] = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[11] = 11;  // 22;  // 4;
-  // 2018   TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-  // 2018
-  // 2018   if (gkConstructCones) {
-  // 2018     // upstream
-  // 2018     TGeoRotation* coneRot21 = new TGeoRotation;
-  // 2018     coneRot21->RotateZ(-90);
-  // 2018     coneRot21->RotateY(180);
-  // 2018     //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-  // 2018     TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.305-gkLadderGapZ/2., coneRot21);
-  // 2018     station02->AddNode(coneSmallVolum, 1, conePosRot21);
-  // 2018
-  // 2018     // downstream
-  // 2018     TGeoRotation* coneRot22 = new TGeoRotation;
-  // 2018     coneRot22->RotateZ(-90);
-  // 2018     //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-  // 2018     TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.305+gkLadderGapZ/2., coneRot22);
-  // 2018     station02->AddNode(coneSmallVolum, 2, conePosRot22);
-  // 2018
-  // 2018     station02->GetShape()->ComputeBBox();
-  // 2018   }
-  // 2018
-  // 2018   CheckVolume(station02);
-  // 2018   CheckVolume(station02, infoFile);
-  // 2018   infoFile << "Position z = " << statPos[1] << endl;
-  // 2018
-  // 2018
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    Double_t posZ       = statPos[iStation - 1] - stsPosZ;
-    //    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    TGeoTranslation* trans = new TGeoTranslation(0., gkSectorOverlapY / 2., posZ);  // mcbm
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd - gkSectorOverlapY;
-  Double_t ladderZ           = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v19a.C b/macro/mcbm/geometry/sts/create_stsgeo_v19a.C
deleted file mode 100644
index c43e78d9c5..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v19a.C
+++ /dev/null
@@ -1,2391 +0,0 @@
-/* Copyright (C) 2012-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v19a.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-08-12 - DE - v19n: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v19a(const char* geoTag = "v19a_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v19a.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // 2018   // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  // 2018   cout << endl;
-  // 2018   statZ = 40.;
-  // 2018   rHole = 2.0;
-  // 2018   nLadders = 3;
-  // 2018   ladderTypes[0]  = 10;
-  // 2018   ladderTypes[1]  = 10;
-  // 2018   ladderTypes[2]  = 10;
-  // 2018 //  ladderTypes[3]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[4]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[5]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[6]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[7]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[8]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[9]  = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[10] = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[11] = 11;  // 22;  // 4;
-  // 2018   TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-  // 2018
-  // 2018   if (gkConstructCones) {
-  // 2018     // upstream
-  // 2018     TGeoRotation* coneRot21 = new TGeoRotation;
-  // 2018     coneRot21->RotateZ(-90);
-  // 2018     coneRot21->RotateY(180);
-  // 2018     //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-  // 2018     TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.305-gkLadderGapZ/2., coneRot21);
-  // 2018     station02->AddNode(coneSmallVolum, 1, conePosRot21);
-  // 2018
-  // 2018     // downstream
-  // 2018     TGeoRotation* coneRot22 = new TGeoRotation;
-  // 2018     coneRot22->RotateZ(-90);
-  // 2018     //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-  // 2018     TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.305+gkLadderGapZ/2., coneRot22);
-  // 2018     station02->AddNode(coneSmallVolum, 2, conePosRot22);
-  // 2018
-  // 2018     station02->GetShape()->ComputeBBox();
-  // 2018   }
-  // 2018
-  // 2018   CheckVolume(station02);
-  // 2018   CheckVolume(station02, infoFile);
-  // 2018   infoFile << "Position z = " << statPos[1] << endl;
-  // 2018
-  // 2018
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v19b.C b/macro/mcbm/geometry/sts/create_stsgeo_v19b.C
deleted file mode 100644
index f19b8d4634..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v19b.C
+++ /dev/null
@@ -1,2419 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v19b.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-08-12 - DE - v19n: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v19b(const char* geoTag = "v19b_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v19b.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ    = 30.;
-  rHole    = 2.0;
-  nLadders = 2;
-  // DEDE
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // 2018   // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  // 2018   cout << endl;
-  // 2018   statZ = 40.;
-  // 2018   rHole = 2.0;
-  // 2018   nLadders = 3;
-  // 2018   ladderTypes[0]  = 10;
-  // 2018   ladderTypes[1]  = 10;
-  // 2018   ladderTypes[2]  = 10;
-  // 2018 //  ladderTypes[3]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[4]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[5]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[6]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[7]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[8]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[9]  = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[10] = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[11] = 11;  // 22;  // 4;
-  // 2018   TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-  // 2018
-  // 2018   if (gkConstructCones) {
-  // 2018     // upstream
-  // 2018     TGeoRotation* coneRot21 = new TGeoRotation;
-  // 2018     coneRot21->RotateZ(-90);
-  // 2018     coneRot21->RotateY(180);
-  // 2018     //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-  // 2018     TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.305-gkLadderGapZ/2., coneRot21);
-  // 2018     station02->AddNode(coneSmallVolum, 1, conePosRot21);
-  // 2018
-  // 2018     // downstream
-  // 2018     TGeoRotation* coneRot22 = new TGeoRotation;
-  // 2018     coneRot22->RotateZ(-90);
-  // 2018     //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-  // 2018     TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.305+gkLadderGapZ/2., coneRot22);
-  // 2018     station02->AddNode(coneSmallVolum, 2, conePosRot22);
-  // 2018
-  // 2018     station02->GetShape()->ComputeBBox();
-  // 2018   }
-  // 2018
-  // 2018   CheckVolume(station02);
-  // 2018   CheckVolume(station02, infoFile);
-  // 2018   infoFile << "Position z = " << statPos[1] << endl;
-  // 2018
-  // 2018
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder(x, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder(x, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder(x, "HalfLadder09d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(x, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  // FU construct ladder 9 only from the lower half ladder. The upper one is
-  // an empty TGeoVolumeAssembly which produces a lot of problems since the
-  // simulation crashes within the TGeoManager
-  //  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(9, nullptr, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder(x, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    // DEDE
-    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    halfLadder->AddNode(module, iSector+1, trans);
-    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    if (ladderid == 9)
-      if (iSector == 0) halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Double_t xu     = 0.;
-  Double_t yu     = 0.;
-  Double_t zu     = 0.;
-
-  // --- Dimensions of half ladders
-  // FU only add half ladder if it exist
-  if (halfLadderU) {
-    shape       = (TGeoBBox*) halfLadderU->GetShape();
-    Double_t xu = 2. * shape->GetDX();
-    Double_t yu = 2. * shape->GetDY();
-    Double_t zu = 2. * shape->GetDZ();
-  }
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  // FU only add half ladder if it exist
-  if (halfLadderU) {
-    Double_t xPosU      = 0.;                    // centred in x
-    Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-    Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-    TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-    ladder->AddNode(halfLadderU, 1, tu);
-  }
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  // FU changes in placement such that the sensor is at the same position
-  // as before the changes
-  /*
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * ( ladderY - yd );  // top aligned
-    zPosD = 0.5 * ( ladderZ - zd );  // back aligned
-  }
-*/
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  // FU changes in placement such that the sensor is at the same position
-  // as before the changes. +0.025 was deducded by try and error
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD + 0.025, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    // drop upstream ladder for mSTS Nov 2019
-    //    station->AddNode(ladder, iLadder+1, trans);
-    cout << "DE222 " << iLadder << endl;
-    if (iLadder == 1) station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v19c.C b/macro/mcbm/geometry/sts/create_stsgeo_v19c.C
deleted file mode 100644
index 77e6429569..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v19c.C
+++ /dev/null
@@ -1,2396 +0,0 @@
-/* Copyright (C) 2012-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v19c.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v19c(const char* geoTag = "v19c_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v19c.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // v19d  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  // v19d  cout << endl;
-  // v19d  statZ = 40.;
-  // v19d  rHole = 2.0;
-  // v19d  nLadders = 3;
-  // v19d  ladderTypes[0]  = 10;
-  // v19d  ladderTypes[1]  = 10;
-  // v19d  ladderTypes[2]  = 10;
-  // v19d  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-  // v19d
-  // v19d  if (gkConstructCones) {
-  // v19d    // upstream
-  // v19d    TGeoRotation* coneRot21 = new TGeoRotation;
-  // v19d    coneRot21->RotateZ(-90);
-  // v19d    coneRot21->RotateY(180);
-  // v19d    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-  // v19d    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.305-gkLadderGapZ/2., coneRot21);
-  // v19d    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-  // v19d
-  // v19d    // downstream
-  // v19d    TGeoRotation* coneRot22 = new TGeoRotation;
-  // v19d    coneRot22->RotateZ(-90);
-  // v19d    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-  // v19d    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.305+gkLadderGapZ/2., coneRot22);
-  // v19d    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-  // v19d
-  // v19d    station02->GetShape()->ComputeBBox();
-  // v19d  }
-  // v19d
-  // v19d  CheckVolume(station02);
-  // v19d  CheckVolume(station02, infoFile);
-  // v19d  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // v19c - 12 cm sensor imported from SIS100 STS create_stsgeo_v19b.C
-  //
-  // ---  Sensor type 05: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = 6.2092;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // v19c  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  // v19c  xSize = 3.1;
-  // v19c  ySize = 4.2;
-  // v19c  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05",
-  // v19c					  xSize/2., ySize/2., zSize/2.);
-  // v19c  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  // v19c  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 6;
-  //  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 6;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v19d.C b/macro/mcbm/geometry/sts/create_stsgeo_v19d.C
deleted file mode 100644
index c9187a7ab6..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v19d.C
+++ /dev/null
@@ -1,2413 +0,0 @@
-/* Copyright (C) 2012-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v19d.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;  // DEJH -> 0.3345 / 0.4600
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;  // DEJH -> 0.07 / 0.07
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;  // DEJH -> 0.25 / 0.25
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v19d(const char* geoTag = "v19d_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v19d.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kRed);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 10;
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 10;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 6;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v19e.C b/macro/mcbm/geometry/sts/create_stsgeo_v19e.C
deleted file mode 100644
index 1badb8fca2..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v19e.C
+++ /dev/null
@@ -1,2461 +0,0 @@
-/* Copyright (C) 2012-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v19e.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;  // DEJH -> 0.3345 / 0.4600
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;  // DEJH -> 0.07 / 0.07
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;  // DEJH -> 0.25 / 0.25
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v19e(const char* geoTag = "v19e_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v19e.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kRed);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 10;
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 10;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder(x, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder(x, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder(x, "HalfLadder09d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(x, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 6;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    // Unit 0
-    if ((ladderType == 9) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 2
-    if ((ladderType == 10) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 right (far from beam)
-    if ((ladderType == 10) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 right (close to beam)
-    if ((ladderType == 10) && (iLadder + 1 == 3)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v19f.C b/macro/mcbm/geometry/sts/create_stsgeo_v19f.C
deleted file mode 100644
index 5612e2f070..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v19f.C
+++ /dev/null
@@ -1,2369 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v19f.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-08-12 - DE - v19n: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v19f(const char* geoTag = "v19f_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v19f.C" << endl << endl;
-  infoFile << "The geometry is the same as sts_v19a_mcbm but in the new "
-              "geometry file format."
-           << endl;
-  infoFile << "The geo file contains the exported sts keeping volume plus" << endl;
-  infoFile << "the corresponding transformation matrix to place it in the experiment." << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kGreen);
-    if (iSensor == 4) sensor->SetLineColor(kBlue);
-    if (iSensor == 5) sensor->SetLineColor(kYellow);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ          = 30.;
-  rHole          = 2.0;
-  nLadders       = 2;
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-  //  ladderTypes[2] =  9;  // 12;  // 2;
-  //  ladderTypes[3] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[4] =  1;  // 11;  // 21;   // 1;
-  //  ladderTypes[5] =  9;  // 12;  // 2;
-  //  ladderTypes[6] =  9;  // 12;  // 2;
-  //  ladderTypes[7] = 10;  // 13;  // 3;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // 2018   // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  // 2018   cout << endl;
-  // 2018   statZ = 40.;
-  // 2018   rHole = 2.0;
-  // 2018   nLadders = 3;
-  // 2018   ladderTypes[0]  = 10;
-  // 2018   ladderTypes[1]  = 10;
-  // 2018   ladderTypes[2]  = 10;
-  // 2018 //  ladderTypes[3]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[4]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[5]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[6]  =  2;  // 21;  // 1;
-  // 2018 //  ladderTypes[7]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[8]  =  9;  // 12;  // 2;
-  // 2018 //  ladderTypes[9]  = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[10] = 10;  // 13;  // 3;
-  // 2018 //  ladderTypes[11] = 11;  // 22;  // 4;
-  // 2018   TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-  // 2018
-  // 2018   if (gkConstructCones) {
-  // 2018     // upstream
-  // 2018     TGeoRotation* coneRot21 = new TGeoRotation;
-  // 2018     coneRot21->RotateZ(-90);
-  // 2018     coneRot21->RotateY(180);
-  // 2018     //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-  // 2018     TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.305-gkLadderGapZ/2., coneRot21);
-  // 2018     station02->AddNode(coneSmallVolum, 1, conePosRot21);
-  // 2018
-  // 2018     // downstream
-  // 2018     TGeoRotation* coneRot22 = new TGeoRotation;
-  // 2018     coneRot22->RotateZ(-90);
-  // 2018     //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-  // 2018     TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.305+gkLadderGapZ/2., coneRot22);
-  // 2018     station02->AddNode(coneSmallVolum, 2, conePosRot22);
-  // 2018
-  // 2018     station02->GetShape()->ComputeBBox();
-  // 2018   }
-  // 2018
-  // 2018   CheckVolume(station02);
-  // 2018   CheckVolume(station02, infoFile);
-  // 2018   infoFile << "Position z = " << statPos[1] << endl;
-  // 2018
-  // 2018
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  //  for (Int_t iStation = 1; iStation<=8; iStation++) {
-  //  for (Int_t iStation = 1; iStation<=2; iStation++) {
-  for (Int_t iStation = 1; iStation <= 1; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-  for (Int_t iStation = 1; iStation <= 2; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-
-  gGeoMan->CloseGeometry();
-
-  gGeoMan->CheckOverlaps(0.00001);
-  gGeoMan->PrintOverlaps();
-
-  gGeoMan->CheckOverlaps(0.00001, "s");
-  gGeoMan->PrintOverlaps();
-
-  gGeoMan->Test();
-
-  sts->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-  cout << "Geometry " << sts->GetName() << " eported to " << geoFileName << endl;
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor Type 01: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 03: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  // ---  Sensor type 05: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-  // ---  Sensor type 06: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: two sensors of type 4
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  Double_t shift5              = 0.5 * gkChainGapY + box4->GetDY();
-  TGeoTranslation* transD5     = new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  TGeoTranslation* transU5     = new TGeoTranslation("tu", 0., shift5, 0.);
-  sector05->AddNode(sensor04, 1, transD5);
-  sector05->AddNode(sensor04, 2, transU5);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 5
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor05, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 6
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor06, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  //  sectorTypes[2] = 3;
-  //  sectorTypes[3] = 4;
-  //  sectorTypes[4] = 4;
-  s0name = Form("Sector%02d", sectorTypes[0]);
-  s0vol  = gGeoMan->GetVolume(s0name);
-  shape  = (TGeoBBox*) s0vol->GetShape();
-  shiftZ = 2. * shape->GetDZ() + gkSectorGapZ;
-  // top  //
-  // top  // top half ladder only
-  // top  //
-  // top  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  // top  //  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  // top  halfLadderD = ConstructHalfLadder("HalfLadder09d", 0, sectorTypes, 'r');
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder("HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder("HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder("HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 3 sectors, type 4 4 4 - mCBM station 2
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  //  sectorTypes[3] = 3;
-  //  sectorTypes[4] = 4;
-  s0name      = Form("Sector%02d", sectorTypes[0]);
-  s0vol       = gGeoMan->GetVolume(s0name);
-  shape       = (TGeoBBox*) s0vol->GetShape();
-  shiftZ      = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU = ConstructHalfLadder("HalfLadder10u", nSectors, sectorTypes, 'l');
-  //  halfLadderD = ConstructHalfLadder("HalfLadder10d", nSectors, sectorTypes, 'r');
-  halfLadderD = ConstructHalfLadder("HalfLadder10d", 0, sectorTypes, 'r');
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 4 sectors, type 3 3 3 3
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder11d", nSectors, sectorTypes, 'r');
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(03, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder("HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder("HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder("HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder("HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v19g.C b/macro/mcbm/geometry/sts/create_stsgeo_v19g.C
deleted file mode 100644
index 0263c41ff2..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v19g.C
+++ /dev/null
@@ -1,1320 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v19g.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2019-08-12 - DE - v19n: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // 0.27;
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // 0.30;
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // 0.00;
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v19g(const char* geoTag = "v19g_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v19g.C" << endl << endl;
-  infoFile << "The geometry is the same as sts_v19b_mcbm but in the new "
-              "geometry file format."
-           << endl;
-  infoFile << "The geo file contains the exported sts keeping volume plus" << endl;
-  infoFile << "the corresponding transformation matrix to place it in the experiment." << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create sensor   ----------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-
-  Int_t iSensor      = 4;
-  TString name       = Form("Sensor%02d", iSensor);
-  TGeoVolume* sensor = gGeoMan->GetVolume(name);
-  sensor->SetLineColor(kBlue);
-  CheckVolume(sensor);
-  CheckVolume(sensor, infoFile);
-  // --------------------------------------------------------------------------
-
-  // ----------------   Create sector   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  Int_t iSector  = 4;
-  cout << endl;
-  name               = Form("Sector%02d", iSector);
-  TGeoVolume* sector = gGeoMan->GetVolume(name);
-  CheckVolume(sector);
-  CheckVolume(sector, infoFile);
-  // --------------------------------------------------------------------------
-
-  // ----------------   Create ladder   ---------------------------------------
-  //TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  Int_t iLadder  = 9;
-  cout << endl;
-  name               = Form("Ladder%02d", iLadder);
-  TGeoVolume* ladder = gGeoMan->GetVolume(name);
-  CheckVolume(ladder);
-  CheckVolume(ladder, infoFile);
-  CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  // --------------------------------------------------------------------------
-
-  // ----------------   Create stations   -------------------------------------
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ    = 30.;
-  rHole    = 2.0;
-  nLadders = 2;
-
-  ladderTypes[0] = 9;
-  ladderTypes[1] = 9;
-
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place station in the STS
-  Int_t iStation         = 1;
-  TString statName       = Form("Station%02d", iStation);
-  TGeoVolume* station    = gGeoMan->GetVolume(statName);
-  Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-  TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-  sts->AddNode(station, iStation, trans);
-  sts->GetShape()->ComputeBBox();
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  sts->Export(geoFileName);
-  TFile* geoFile = new TFile(geoFileName, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = 6.2092;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoBBox* box4       = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 09: 2 sectors, type 4 4 - mCBM station 1
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  //  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  ConstructLadder(9, nullptr, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    // DEDE
-    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    halfLadder->AddNode(module, iSector+1, trans);
-    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    if (ladderid == 9)
-      if (iSector == 0) halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Double_t xu     = 0.;
-  Double_t yu     = 0.;
-  Double_t zu     = 0.;
-
-  // --- Dimensions of half ladders
-  if (halfLadderU) {
-    shape       = (TGeoBBox*) halfLadderU->GetShape();
-    Double_t xu = 2. * shape->GetDX();
-    Double_t yu = 2. * shape->GetDY();
-    Double_t zu = 2. * shape->GetDZ();
-  }
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  if (halfLadderU) {
-    Double_t xPosU      = 0.;                    // centred in x
-    Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-    Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-    TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-    ladder->AddNode(halfLadderU, 1, tu);
-  }
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-  //  Double_t zPosD = 0.75 * ( zd - ladderZ );  // back aligned
-
-  cout << "ZPOS=" << zPosD << endl;
-  /*
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * ( ladderY - yd );  // top aligned
-    zPosD = 0.5 * ( ladderZ - zd );  // back aligned
-  }
-*/
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD + 0.025, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) {
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-  }
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-    // drop upstream ladder for mSTS Nov 2019
-    //    station->AddNode(ladder, iLadder+1, trans);
-    cout << "DE222 " << iLadder << endl;
-    if (iLadder == 1) station->AddNode(ladder, iLadder + 1, trans);
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v20a.C b/macro/mcbm/geometry/sts/create_stsgeo_v20a.C
deleted file mode 100644
index a2e35dd8f8..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v20a.C
+++ /dev/null
@@ -1,2457 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v20a.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;  // DEJH -> 0.3345 / 0.4600
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // Oleg mSTS CAD 06/05/2020
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;  // DEJH -> 0.25 / 0.25
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v20a(const char* geoTag = "v20a_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v20a.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kRed);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 11;  // triple ladder
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 10;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 1;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    //   // Unit 0
-    //   if ((ladderType == 9) && (iLadder+1 == 1))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    //   // Unit 2
-    //   if ((ladderType == 10) && (iLadder+1 == 2))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    //   // Unit 3 right (far from beam)
-    //   if ((ladderType == 11) && (iLadder+1 == 1))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    //   // Unit 3 left (close to beam)
-    //   if ((ladderType == 10) && (iLadder+1 == 3))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v20b.C b/macro/mcbm/geometry/sts/create_stsgeo_v20b.C
deleted file mode 100644
index fa77d3e7d4..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v20b.C
+++ /dev/null
@@ -1,2456 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v20b.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;  // DEJH -> 0.3345 / 0.4600
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // Oleg mSTS CAD 06/05/2020
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;  // DEJH -> 0.25 / 0.25
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v20b(const char* geoTag = "v20b_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v20b.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kRed);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 11;  // triple ladder
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 10;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 2;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    //   // Unit 0
-    //   if ((ladderType == 9) && (iLadder+1 == 1))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    //   // Unit 2
-    //   if ((ladderType == 10) && (iLadder+1 == 2))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    //   // Unit 3 right (far from beam)
-    //   if ((ladderType == 11) && (iLadder+1 == 1))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    // Unit 3 left (close to beam)
-    if ((ladderType == 10) && (iLadder + 1 == 3)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v20c.C b/macro/mcbm/geometry/sts/create_stsgeo_v20c.C
deleted file mode 100644
index b65b7ec521..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v20c.C
+++ /dev/null
@@ -1,2453 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v20c.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;  // DEJH -> 0.3345 / 0.4600
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // Oleg mSTS CAD 06/05/2020
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;  // DEJH -> 0.25 / 0.25
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v20c(const char* geoTag = "v20c_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v20c.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kRed);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 11;  // triple ladder
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 10;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 2;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    // Unit 0
-    if ((ladderType == 9) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 2
-    if ((ladderType == 10) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 right (far from beam)
-    if ((ladderType == 11) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 left (close to beam)
-    if ((ladderType == 10) && (iLadder + 1 == 3)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v20d.C b/macro/mcbm/geometry/sts/create_stsgeo_v20d.C
deleted file mode 100644
index 3ce63e176f..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v20d.C
+++ /dev/null
@@ -1,2458 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v20d.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2020-03-21 - DE - v20d: build mSTS for March 2020 - 1 ladder - shift -3 cm in x 
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.27;  // DEJH -> 0.3345 / 0.4600
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // Oleg mSTS CAD 06/05/2020
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.30;  // DEJH -> 0.25 / 0.25
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v20d(const char* geoTag = "v20d_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v20d.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kRed);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 11;  // triple ladder
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 10;
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 1;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(-3., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    //   // Unit 0
-    //   if ((ladderType == 9) && (iLadder+1 == 1))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    //   // Unit 2
-    //   if ((ladderType == 10) && (iLadder+1 == 2))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    //   // Unit 3 right (far from beam)
-    //   if ((ladderType == 11) && (iLadder+1 == 1))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    //   // Unit 3 left (close to beam)
-    //   if ((ladderType == 10) && (iLadder+1 == 3))
-    //   {
-    //     cout << "including " << ladderName << " " << ladderType << " " << iLadder+1 << endl;
-    //     station->AddNode(ladder, iLadder+1, trans);
-    //   }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v20e.C b/macro/mcbm/geometry/sts/create_stsgeo_v20e.C
deleted file mode 100644
index 4e53957ea5..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v20e.C
+++ /dev/null
@@ -1,2455 +0,0 @@
-/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Volker Friese, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v20e.C
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2020-05-16 - DE - v20e: swap ladders in unit 3 - 3x 6x6 on beam side
- ** 2020-03-21 - DE - v20d: build mSTS for March 2020 - 1 ladder - shift -3 cm in x
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // delta X - Oleg CAD 14/05/2020
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // delta Y - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // gap + thickness = pitch // delta Z pitch = 0.20 - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v20e(const char* geoTag = "v20e_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v20e.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kAzure + 7);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 10;
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 11;  // triple ladder
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 2;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  top->Write();
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << geoFileName << endl;
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  TString geoFileName__ = "sts_";
-  geoFileName_          = geoFileName__ + geoTag + "-geo.root";
-  sts->Export(geoFileName_);
-
-  geoFile = new TFile(geoFileName_, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    // Unit 0
-    if ((ladderType == 9) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 2
-    if ((ladderType == 10) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 right (far from beam)
-    if ((ladderType == 10) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 left (close to beam)
-    if ((ladderType == 11) && (iLadder + 1 == 3)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v22a.C b/macro/mcbm/geometry/sts/create_stsgeo_v22a.C
deleted file mode 100644
index ab51480c3b..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v22a.C
+++ /dev/null
@@ -1,2757 +0,0 @@
-/* Copyright (C) 2012-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v22a.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2022-01-25 - DE - v22a: add a aluminium box around v20e
- ** 2020-05-16 - DE - v20e: swap ladders in unit 3 - 3x 6x6 on beam side
- ** 2020-03-21 - DE - v20d: build mSTS for March 2020 - 1 ladder - shift -3 cm in x
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // delta X - Oleg CAD 14/05/2020
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // delta Y - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // gap + thickness = pitch // delta Z pitch = 0.20 - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSubplates();
-Int_t CreatePlates();
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v22a(const char* geoTag = "v22a_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v22a.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> aluminium
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (!mAluminium) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  if (!aluminium) Fatal("Main", "Medium aluminium not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kAzure + 7);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 10;
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 11;  // triple ladder
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create subplates   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating subplates...." << endl << endl;
-  infoFile << endl << "Subplates: " << endl;
-  Int_t nSubplates = CreateSubplates();
-  for (Int_t iSubplate = 1; iSubplate <= nSubplates; iSubplate++) {
-    TString name         = Form("Subplate%02d", iSubplate);
-    TGeoVolume* subplate = gGeoMan->GetVolume(name);
-
-    // add color to plates
-    subplate->SetTransparency(60);
-    if (iSubplate == 1) subplate->SetLineColor(kOrange);  // kOrange);
-    if (iSubplate == 2) subplate->SetLineColor(kOrange);  // kRed);
-    if (iSubplate == 3) subplate->SetLineColor(kOrange);  // kGreen);
-
-    if (iSubplate == 4) subplate->SetLineColor(kOrange);  // kRed);
-    if (iSubplate == 5) subplate->SetLineColor(kOrange);  // kOrange);
-    if (iSubplate == 6) subplate->SetLineColor(kOrange);  // kCyan);
-
-    if (iSubplate == 7) subplate->SetLineColor(kOrange);  // kRed);
-
-    if (iSubplate == 8) subplate->SetLineColor(kOrange);   // kGreen);
-    if (iSubplate == 9) subplate->SetLineColor(kOrange);   // kGreen);
-    if (iSubplate == 10) subplate->SetLineColor(kOrange);  // kGreen);
-
-    //    CheckVolume(plate);
-    //    CheckVolume(plate, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create plates   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating plates...." << endl << endl;
-  infoFile << endl << "Plates: " << endl;
-  Int_t nPlates = CreatePlates();
-  for (Int_t iPlate = 1; iPlate <= nPlates; iPlate++) {
-    TString name      = Form("Plate%02d", iPlate);
-    TGeoVolume* plate = gGeoMan->GetVolume(name);
-    //    CheckVolume(plate);
-    //    CheckVolume(plate, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 2;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-
-  // plates
-  for (Int_t iPlate = 1; iPlate <= nPlates; iPlate++) {
-    TString platName  = Form("Plate%02d", iPlate);
-    TGeoVolume* plate = gGeoMan->GetVolume(platName);
-    //  Double_t posZ          = 0; // platPos[iPlate - 1] - stsPosZ;
-    //  TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    //  sts->AddNode(plate, iPlate, trans);
-    sts->AddNode(plate, iPlate);
-    sts->GetShape()->ComputeBBox();
-  }
-
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(0., 0., stsPosZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  sts->Export(geoFileName);
-  cout << endl;
-  cout << "Geometry " << sts->GetName() << " exported to " << geoFileName << endl;
-  geoFile->Close();
-
-  geoFile = new TFile(geoFileName, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-Int_t CreateSubplates()
-{
-
-  Int_t nSubplates = 0;
-
-  Double_t xSize        = 0.;
-  Double_t ySize        = 0.;
-  Double_t zSize        = 0.5;  // cm  // gkSubplateThickness;
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-
-  // xsize 830 / (830 - 115+137-12) = 590
-
-  // ysize 518 / 222 / 125 = 865
-  // ysize 530 / 198 / 137   // corrected for 12 mm rim
-
-  // center z-axis in front cutout
-  // ysize 518 + 222/2. = 629
-  // ysize 530 + 198/2. = 629
-
-  // center z-axis in front cutout
-  // xsize 830/2. - (115 + 137)/2. = 415 - 126 = 289
-
-  // ---  Subplate type 01: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 53.0;  // cm
-  TGeoBBox* shape_subplate01 = new TGeoBBox("subplate01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate01", shape_subplate01, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 02: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 59.0;  // cm
-  ySize                      = 19.8;  // cm
-  TGeoBBox* shape_subplate02 = new TGeoBBox("subplate02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate02", shape_subplate02, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 03: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 13.7;  // cm
-  TGeoBBox* shape_subplate03 = new TGeoBBox("subplate03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate03", shape_subplate03, aluminium);
-  nSubplates++;
-
-  // xsize 830 / (830 - 340 - 25) = 465
-  // ysize 483 / 293 / 89 = 865
-
-  // center z-axis in back cutout
-  // ysize 483 + 293/2. = 629.5
-
-  // center z-axis in backside cutout
-  // xsize 830/2. - ( 340/2. + 25 ) = 415 - 220 = 195
-
-  // ---  Subplate type 04: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 48.3;  // cm
-  TGeoBBox* shape_subplate04 = new TGeoBBox("subplate04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate04", shape_subplate04, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 05: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 46.5;  // cm
-  ySize                      = 29.3;  // cm
-  TGeoBBox* shape_subplate05 = new TGeoBBox("subplate05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate05", shape_subplate05, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 06: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 8.9;   // cm
-  TGeoBBox* shape_subplate06 = new TGeoBBox("subplate06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate06", shape_subplate06, aluminium);
-  nSubplates++;
-
-  // bottom / top
-  // ---  Subplate type 07: bottom/top plate (83.0 cm x 34.0 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate07 = new TGeoBBox("subplate07", xSize / 2., zSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate07", shape_subplate07, aluminium);
-  nSubplates++;
-
-  // right
-  // ---  Subplate type 08: right plate
-  xSize                      = 85.5;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate08 = new TGeoBBox("subplate08", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate08", shape_subplate08, aluminium);
-  nSubplates++;
-
-  // left bottom
-  // ---  Subplate type 09: left plate
-  xSize                      = 52.5;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate09 = new TGeoBBox("subplate09", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate09", shape_subplate09, aluminium);
-  nSubplates++;
-
-  // left top
-  // ---  Subplate type 10: left plate
-  xSize                      = 13.2;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate10 = new TGeoBBox("subplate10", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate10", shape_subplate10, aluminium);
-  nSubplates++;
-
-  return nSubplates;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-Int_t CreatePlates()
-{
-
-  Int_t nPlates = 0;
-
-  Double_t box_dx = 83.0;  // cm
-  Double_t box_dy = 86.5;  // cm
-
-  //  Double_t dx = 0;  // cm
-  //  Double_t dx = -(box_dx/2 - 19.5);  // cm - backside center
-  //  Double_t dx = -(box_dx/2 - 12.6);  // cm - frontside center
-  Double_t dx = -box_dx / 2 + 15.7;  // cm - from CAD drawing
-
-  Double_t dy = box_dy / 2 - 62.9;  // cm - from CAD drawing 23,6 cm
-
-  //  Double_t box_dz_inner = 0;  // cm
-  Double_t box_dz_inner = 34.0;  // cm
-
-  TGeoVolume* subplate01 = gGeoMan->GetVolume("Subplate01");
-  TGeoVolume* subplate02 = gGeoMan->GetVolume("Subplate02");
-  TGeoVolume* subplate03 = gGeoMan->GetVolume("Subplate03");
-  TGeoBBox* box01        = (TGeoBBox*) subplate01->GetShape();
-  TGeoBBox* box02        = (TGeoBBox*) subplate02->GetShape();
-  TGeoBBox* box03        = (TGeoBBox*) subplate03->GetShape();
-
-  TGeoVolume* subplate04 = gGeoMan->GetVolume("Subplate04");
-  TGeoVolume* subplate05 = gGeoMan->GetVolume("Subplate05");
-  TGeoVolume* subplate06 = gGeoMan->GetVolume("Subplate06");
-  TGeoBBox* box04        = (TGeoBBox*) subplate04->GetShape();
-  TGeoBBox* box05        = (TGeoBBox*) subplate05->GetShape();
-  TGeoBBox* box06        = (TGeoBBox*) subplate06->GetShape();
-
-  TGeoVolume* subplate07 = gGeoMan->GetVolume("Subplate07");
-  TGeoBBox* box07        = (TGeoBBox*) subplate07->GetShape();
-
-  TGeoVolume* subplate08 = gGeoMan->GetVolume("Subplate08");
-  TGeoBBox* box08        = (TGeoBBox*) subplate08->GetShape();
-
-  TGeoVolume* subplate09 = gGeoMan->GetVolume("Subplate09");
-  TGeoBBox* box09        = (TGeoBBox*) subplate09->GetShape();
-
-  TGeoVolume* subplate10 = gGeoMan->GetVolume("Subplate10");
-  TGeoBBox* box10        = (TGeoBBox*) subplate10->GetShape();
-
-  // --- Plate type 1: front plate made of 3 subplates
-  TGeoVolumeAssembly* plate01 = new TGeoVolumeAssembly("Plate01");
-  Double_t sy01               = -box_dy / 2. + box01->GetDY();
-  Double_t sz01               = -(box01->GetDZ() + box_dz_inner / 2.);
-  TGeoTranslation* ty01       = new TGeoTranslation("ty01", dx, sy01 + dy, sz01);
-  plate01->AddNode(subplate01, 1, ty01);
-  Double_t sx02         = -box_dx / 2. + box02->GetDX();
-  Double_t sy02         = -box_dy / 2. + box01->GetDY() * 2 + box02->GetDY();
-  TGeoTranslation* ty02 = new TGeoTranslation("ty02", sx02 + dx, sy02 + dy, sz01);
-  plate01->AddNode(subplate02, 2, ty02);
-  Double_t sy03         = -box_dy / 2. + box01->GetDY() * 2 + box02->GetDY() * 2 + box03->GetDY();
-  TGeoTranslation* ty03 = new TGeoTranslation("ty03", dx, sy03 + dy, sz01);
-  plate01->AddNode(subplate03, 3, ty03);
-  plate01->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 2: back plate made of 3 subplates
-  TGeoVolumeAssembly* plate02 = new TGeoVolumeAssembly("Plate02");
-  Double_t sy04               = -box_dy / 2. + box04->GetDY();
-  Double_t sz04               = box04->GetDZ() + box_dz_inner / 2.;
-  TGeoTranslation* ty04       = new TGeoTranslation("ty04", dx, sy04 + dy, sz04);
-  plate02->AddNode(subplate04, 1, ty04);
-  Double_t sx05         = -box_dx / 2. + box05->GetDX();
-  Double_t sy05         = -box_dy / 2. + box04->GetDY() * 2 + box05->GetDY();
-  TGeoTranslation* ty05 = new TGeoTranslation("ty05", sx05 + dx, sy05 + dy, sz04);
-  plate02->AddNode(subplate05, 2, ty05);
-  Double_t sy06         = -box_dy / 2. + box04->GetDY() * 2 + box05->GetDY() * 2 + box06->GetDY();
-  TGeoTranslation* ty06 = new TGeoTranslation("ty06", dx, sy06 + dy, sz04);
-  plate02->AddNode(subplate06, 3, ty06);
-  plate02->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 3: bottom plate
-  TGeoVolumeAssembly* plate03 = new TGeoVolumeAssembly("Plate03");
-  Double_t sy07               = box_dy / 2. - box07->GetDY();
-  TGeoTranslation* ty07       = new TGeoTranslation("ty07", dx, -sy07 + dy, 0.);
-  plate03->AddNode(subplate07, 1, ty07);
-  plate03->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 4: top plate
-  TGeoVolumeAssembly* plate04 = new TGeoVolumeAssembly("Plate04");
-  TGeoTranslation* ty17       = new TGeoTranslation("ty17", dx, sy07 + dy, 0.);
-  plate04->AddNode(subplate07, 1, ty17);
-  plate04->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 5: -x plate
-  TGeoVolumeAssembly* plate05 = new TGeoVolumeAssembly("Plate05");
-  Double_t sx08               = box_dx / 2. - box08->GetDX();
-  TGeoTranslation* ty08       = new TGeoTranslation("ty08", -sx08 + dx, dy, 0.);
-  plate05->AddNode(subplate08, 1, ty08);
-  plate05->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 6: +x plate (shorted due to beampipe)
-  TGeoVolumeAssembly* plate06 = new TGeoVolumeAssembly("Plate06");
-  Double_t sy09               = -box_dy / 2. + box09->GetDY() + 2 * box09->GetDX();
-  TGeoTranslation* ty09       = new TGeoTranslation("ty09", sx08 + dx, sy09 + dy, 0.);
-  plate06->AddNode(subplate09, 1, ty09);
-  plate06->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 7: +x plate (shorted due to beampipe)
-  TGeoVolumeAssembly* plate07 = new TGeoVolumeAssembly("Plate07");
-  Double_t sy10               = -box_dy / 2. + box10->GetDY() + 2 * box10->GetDX();
-  TGeoTranslation* ty10       = new TGeoTranslation("ty10", sx08 + dx, -sy10 + dy, 0.);
-  plate07->AddNode(subplate10, 1, ty10);
-  plate07->GetShape()->ComputeBBox();
-  nPlates++;
-
-  return nPlates;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    // Unit 0
-    if ((ladderType == 9) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 2
-    if ((ladderType == 10) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 right (far from beam)
-    if ((ladderType == 10) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 left (close to beam)
-    if ((ladderType == 11) && (iLadder + 1 == 3)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v22b.C b/macro/mcbm/geometry/sts/create_stsgeo_v22b.C
deleted file mode 100644
index 3b6de175a1..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v22b.C
+++ /dev/null
@@ -1,2766 +0,0 @@
-/* Copyright (C) 2012-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v22b.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2022-02-01 - DE - v22b: add position offset for mSTS 07_2021 as surveyed in the cave
- ** 2022-01-25 - DE - v22a: add a aluminium box around v20e
- ** 2020-05-16 - DE - v20e: swap ladders in unit 3 - 3x 6x6 on beam side
- ** 2020-03-21 - DE - v20d: build mSTS for March 2020 - 1 ladder - shift -3 cm in x
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Installation offset      -----------------------------------
-
-// position in x and y agrees within 2 mm to CbmRoot geometry (01.02.2022)
-const Double_t gOffX = 0.0;  // Offset from nominal position
-const Double_t gOffY = 0.0;  // Offset from nominal position
-const Double_t gOffZ = 7.0;  // Offset from nominal position
-
-const Bool_t IncludeBox = true;  // false;  // true, if STS box is plotted
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // delta X - Oleg CAD 14/05/2020
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // delta Y - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // gap + thickness = pitch // delta Z pitch = 0.20 - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSubplates();
-Int_t CreatePlates();
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v22b(const char* geoTag = "v22b_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v22b.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> aluminium
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (!mAluminium) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  if (!aluminium) Fatal("Main", "Medium aluminium not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kAzure + 7);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 10;
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 11;  // triple ladder
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create subplates   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating subplates...." << endl << endl;
-  infoFile << endl << "Subplates: " << endl;
-  Int_t nSubplates = CreateSubplates();
-  for (Int_t iSubplate = 1; iSubplate <= nSubplates; iSubplate++) {
-    TString name         = Form("Subplate%02d", iSubplate);
-    TGeoVolume* subplate = gGeoMan->GetVolume(name);
-
-    // add color to plates
-    subplate->SetTransparency(60);
-    if (iSubplate == 1) subplate->SetLineColor(kOrange);  // kOrange);
-    if (iSubplate == 2) subplate->SetLineColor(kOrange);  // kRed);
-    if (iSubplate == 3) subplate->SetLineColor(kOrange);  // kGreen);
-
-    if (iSubplate == 4) subplate->SetLineColor(kOrange);  // kRed);
-    if (iSubplate == 5) subplate->SetLineColor(kOrange);  // kOrange);
-    if (iSubplate == 6) subplate->SetLineColor(kOrange);  // kCyan);
-
-    if (iSubplate == 7) subplate->SetLineColor(kOrange);  // kRed);
-
-    if (iSubplate == 8) subplate->SetLineColor(kOrange);   // kGreen);
-    if (iSubplate == 9) subplate->SetLineColor(kOrange);   // kGreen);
-    if (iSubplate == 10) subplate->SetLineColor(kOrange);  // kGreen);
-
-    //    CheckVolume(plate);
-    //    CheckVolume(plate, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create plates   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating plates...." << endl << endl;
-  infoFile << endl << "Plates: " << endl;
-  Int_t nPlates = CreatePlates();
-  for (Int_t iPlate = 1; iPlate <= nPlates; iPlate++) {
-    TString name      = Form("Plate%02d", iPlate);
-    TGeoVolume* plate = gGeoMan->GetVolume(name);
-    //    CheckVolume(plate);
-    //    CheckVolume(plate, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 2;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-
-
-  // plates
-  if (IncludeBox)
-    for (Int_t iPlate = 1; iPlate <= nPlates; iPlate++) {
-      TString platName  = Form("Plate%02d", iPlate);
-      TGeoVolume* plate = gGeoMan->GetVolume(platName);
-      sts->AddNode(plate, iPlate);
-      sts->GetShape()->ComputeBBox();
-    }
-
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(gOffX, gOffY, stsPosZ + gOffZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  sts->Export(geoFileName);
-  cout << endl;
-  cout << "Geometry " << sts->GetName() << " exported to " << geoFileName << endl;
-  geoFile->Close();
-
-  geoFile = new TFile(geoFileName, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-Int_t CreateSubplates()
-{
-
-  Int_t nSubplates = 0;
-
-  Double_t xSize        = 0.;
-  Double_t ySize        = 0.;
-  Double_t zSize        = 0.5;  // cm  // gkSubplateThickness;
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-
-  // xsize 830 / (830 - 115+137-12) = 590
-
-  // ysize 518 / 222 / 125 = 865
-  // ysize 530 / 198 / 137   // corrected for 12 mm rim
-
-  // center z-axis in front cutout
-  // ysize 518 + 222/2. = 629
-  // ysize 530 + 198/2. = 629
-
-  // center z-axis in front cutout
-  // xsize 830/2. - (115 + 137)/2. = 415 - 126 = 289
-
-  // ---  Subplate type 01: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 53.0;  // cm
-  TGeoBBox* shape_subplate01 = new TGeoBBox("subplate01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate01", shape_subplate01, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 02: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 59.0;  // cm
-  ySize                      = 19.8;  // cm
-  TGeoBBox* shape_subplate02 = new TGeoBBox("subplate02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate02", shape_subplate02, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 03: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 13.7;  // cm
-  TGeoBBox* shape_subplate03 = new TGeoBBox("subplate03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate03", shape_subplate03, aluminium);
-  nSubplates++;
-
-  // xsize 830 / (830 - 340 - 25) = 465
-  // ysize 483 / 293 / 89 = 865
-
-  // center z-axis in back cutout
-  // ysize 483 + 293/2. = 629.5
-
-  // center z-axis in backside cutout
-  // xsize 830/2. - ( 340/2. + 25 ) = 415 - 220 = 195
-
-  // ---  Subplate type 04: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 48.3;  // cm
-  TGeoBBox* shape_subplate04 = new TGeoBBox("subplate04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate04", shape_subplate04, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 05: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 46.5;  // cm
-  ySize                      = 29.3;  // cm
-  TGeoBBox* shape_subplate05 = new TGeoBBox("subplate05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate05", shape_subplate05, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 06: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 8.9;   // cm
-  TGeoBBox* shape_subplate06 = new TGeoBBox("subplate06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate06", shape_subplate06, aluminium);
-  nSubplates++;
-
-  // bottom / top
-  // ---  Subplate type 07: bottom/top plate (83.0 cm x 34.0 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate07 = new TGeoBBox("subplate07", xSize / 2., zSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate07", shape_subplate07, aluminium);
-  nSubplates++;
-
-  // right
-  // ---  Subplate type 08: right plate
-  xSize                      = 85.5;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate08 = new TGeoBBox("subplate08", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate08", shape_subplate08, aluminium);
-  nSubplates++;
-
-  // left bottom
-  // ---  Subplate type 09: left plate
-  xSize                      = 52.5;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate09 = new TGeoBBox("subplate09", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate09", shape_subplate09, aluminium);
-  nSubplates++;
-
-  // left top
-  // ---  Subplate type 10: left plate
-  xSize                      = 13.2;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate10 = new TGeoBBox("subplate10", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate10", shape_subplate10, aluminium);
-  nSubplates++;
-
-  return nSubplates;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-Int_t CreatePlates()
-{
-
-  Int_t nPlates = 0;
-
-  Double_t box_dx = 83.0;  // cm
-  Double_t box_dy = 86.5;  // cm
-
-  //  Double_t dx = 0;  // cm
-  //  Double_t dx = -(box_dx/2 - 19.5);  // cm - backside center
-  //  Double_t dx = -(box_dx/2 - 12.6);  // cm - frontside center
-  Double_t dx = -box_dx / 2 + 15.7;  // cm - from CAD drawing
-
-  Double_t dy = box_dy / 2 - 62.9;  // cm - from CAD drawing 23,6 cm
-
-  //  Double_t box_dz_inner = 0;  // cm
-  Double_t box_dz_inner = 34.0;  // cm
-
-  TGeoVolume* subplate01 = gGeoMan->GetVolume("Subplate01");
-  TGeoVolume* subplate02 = gGeoMan->GetVolume("Subplate02");
-  TGeoVolume* subplate03 = gGeoMan->GetVolume("Subplate03");
-  TGeoBBox* box01        = (TGeoBBox*) subplate01->GetShape();
-  TGeoBBox* box02        = (TGeoBBox*) subplate02->GetShape();
-  TGeoBBox* box03        = (TGeoBBox*) subplate03->GetShape();
-
-  TGeoVolume* subplate04 = gGeoMan->GetVolume("Subplate04");
-  TGeoVolume* subplate05 = gGeoMan->GetVolume("Subplate05");
-  TGeoVolume* subplate06 = gGeoMan->GetVolume("Subplate06");
-  TGeoBBox* box04        = (TGeoBBox*) subplate04->GetShape();
-  TGeoBBox* box05        = (TGeoBBox*) subplate05->GetShape();
-  TGeoBBox* box06        = (TGeoBBox*) subplate06->GetShape();
-
-  TGeoVolume* subplate07 = gGeoMan->GetVolume("Subplate07");
-  TGeoBBox* box07        = (TGeoBBox*) subplate07->GetShape();
-
-  TGeoVolume* subplate08 = gGeoMan->GetVolume("Subplate08");
-  TGeoBBox* box08        = (TGeoBBox*) subplate08->GetShape();
-
-  TGeoVolume* subplate09 = gGeoMan->GetVolume("Subplate09");
-  TGeoBBox* box09        = (TGeoBBox*) subplate09->GetShape();
-
-  TGeoVolume* subplate10 = gGeoMan->GetVolume("Subplate10");
-  TGeoBBox* box10        = (TGeoBBox*) subplate10->GetShape();
-
-  // --- Plate type 1: front plate made of 3 subplates
-  TGeoVolumeAssembly* plate01 = new TGeoVolumeAssembly("Plate01");
-  Double_t sy01               = -box_dy / 2. + box01->GetDY();
-  Double_t sz01               = -(box01->GetDZ() + box_dz_inner / 2.);
-  TGeoTranslation* ty01       = new TGeoTranslation("ty01", dx, sy01 + dy, sz01);
-  plate01->AddNode(subplate01, 1, ty01);
-  Double_t sx02         = -box_dx / 2. + box02->GetDX();
-  Double_t sy02         = -box_dy / 2. + box01->GetDY() * 2 + box02->GetDY();
-  TGeoTranslation* ty02 = new TGeoTranslation("ty02", sx02 + dx, sy02 + dy, sz01);
-  plate01->AddNode(subplate02, 2, ty02);
-  Double_t sy03         = -box_dy / 2. + box01->GetDY() * 2 + box02->GetDY() * 2 + box03->GetDY();
-  TGeoTranslation* ty03 = new TGeoTranslation("ty03", dx, sy03 + dy, sz01);
-  plate01->AddNode(subplate03, 3, ty03);
-  plate01->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 2: back plate made of 3 subplates
-  TGeoVolumeAssembly* plate02 = new TGeoVolumeAssembly("Plate02");
-  Double_t sy04               = -box_dy / 2. + box04->GetDY();
-  Double_t sz04               = box04->GetDZ() + box_dz_inner / 2.;
-  TGeoTranslation* ty04       = new TGeoTranslation("ty04", dx, sy04 + dy, sz04);
-  plate02->AddNode(subplate04, 1, ty04);
-  Double_t sx05         = -box_dx / 2. + box05->GetDX();
-  Double_t sy05         = -box_dy / 2. + box04->GetDY() * 2 + box05->GetDY();
-  TGeoTranslation* ty05 = new TGeoTranslation("ty05", sx05 + dx, sy05 + dy, sz04);
-  plate02->AddNode(subplate05, 2, ty05);
-  Double_t sy06         = -box_dy / 2. + box04->GetDY() * 2 + box05->GetDY() * 2 + box06->GetDY();
-  TGeoTranslation* ty06 = new TGeoTranslation("ty06", dx, sy06 + dy, sz04);
-  plate02->AddNode(subplate06, 3, ty06);
-  plate02->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 3: bottom plate
-  TGeoVolumeAssembly* plate03 = new TGeoVolumeAssembly("Plate03");
-  Double_t sy07               = box_dy / 2. - box07->GetDY();
-  TGeoTranslation* ty07       = new TGeoTranslation("ty07", dx, -sy07 + dy, 0.);
-  plate03->AddNode(subplate07, 1, ty07);
-  plate03->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 4: top plate
-  TGeoVolumeAssembly* plate04 = new TGeoVolumeAssembly("Plate04");
-  TGeoTranslation* ty17       = new TGeoTranslation("ty17", dx, sy07 + dy, 0.);
-  plate04->AddNode(subplate07, 1, ty17);
-  plate04->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 5: -x plate
-  TGeoVolumeAssembly* plate05 = new TGeoVolumeAssembly("Plate05");
-  Double_t sx08               = box_dx / 2. - box08->GetDX();
-  TGeoTranslation* ty08       = new TGeoTranslation("ty08", -sx08 + dx, dy, 0.);
-  plate05->AddNode(subplate08, 1, ty08);
-  plate05->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 6: +x plate (shorted due to beampipe)
-  TGeoVolumeAssembly* plate06 = new TGeoVolumeAssembly("Plate06");
-  Double_t sy09               = -box_dy / 2. + box09->GetDY() + 2 * box09->GetDX();
-  TGeoTranslation* ty09       = new TGeoTranslation("ty09", sx08 + dx, sy09 + dy, 0.);
-  plate06->AddNode(subplate09, 1, ty09);
-  plate06->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 7: +x plate (shorted due to beampipe)
-  TGeoVolumeAssembly* plate07 = new TGeoVolumeAssembly("Plate07");
-  Double_t sy10               = -box_dy / 2. + box10->GetDY() + 2 * box10->GetDX();
-  TGeoTranslation* ty10       = new TGeoTranslation("ty10", sx08 + dx, -sy10 + dy, 0.);
-  plate07->AddNode(subplate10, 1, ty10);
-  plate07->GetShape()->ComputeBBox();
-  nPlates++;
-
-  return nPlates;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    // Unit 0
-    if ((ladderType == 9) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 2
-    if ((ladderType == 10) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 right (far from beam)
-    if ((ladderType == 10) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 left (close to beam)
-    if ((ladderType == 11) && (iLadder + 1 == 3)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/create_stsgeo_v22c.C b/macro/mcbm/geometry/sts/create_stsgeo_v22c.C
deleted file mode 100644
index 9d91975d7a..0000000000
--- a/macro/mcbm/geometry/sts/create_stsgeo_v22c.C
+++ /dev/null
@@ -1,2767 +0,0 @@
-/* Copyright (C) 2012-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of STS geometry in ROOT format (TGeo).
- **
- ** @file create_stsgeo_v22c.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Volker Friese <v.friese@gsi.de>
- ** @since 15 June 2012
- ** @date 09.05.2014
- ** @author Tomas Balog <T.Balog@gsi.de>
- **
- ** 2022-02-01 - DE - v22c: v22b without box for mSTS 07_2021 as surveyed in the cave
- ** 2022-02-01 - DE - v22b: add position offset for mSTS 07_2021 as surveyed in the cave
- ** 2022-01-25 - DE - v22a: add a aluminium box around v20e
- ** 2020-05-16 - DE - v20e: swap ladders in unit 3 - 3x 6x6 on beam side
- ** 2020-03-21 - DE - v20d: build mSTS for March 2020 - 1 ladder - shift -3 cm in x
- ** 2020-03-11 - DE - v20c: build mSTS for March 2021 - 5 ladders
- ** 2020-03-11 - DE - v20b: build mSTS for May   2020 - 2 ladders
- ** 2020-03-11 - DE - v20a: build mSTS for March 2020 - 1 ladder
- **
- ** 2019-12-04 - DE - v19d: build 2nd mSTS v19d station from one 6x6 and one 6x12 cm x cm sensors
- ** 2019-12-04 - DE - v19c: build 1st mSTS v19c station at nominal position
- ** 2019-08-12 - DE - v19a: mSTS as built in March 2019 - the mSTS FEBs are in the bottom
- ** 2019-03-15 - DE - v18n: mSTS as built in March 2019 - downstream ladder of station 0 at position of station 1
- ** 2018-01-18 - DE - v18g: set overlaps in X and Y according to mSTS CAD model
- **
- ** v18f: flip orientation of carbon ladders for primary beam left of mSTS, change z-positions to 30 and 45 cm
- ** v18e: 2 stations, derived from v15b, 1st 2x2, 2nd of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18d: 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18c: (causes segfault due to divide) 2 stations of 3x3 sensor array, sensor size 6x6 cm2 with carbon ladder supports
- ** v18b: 2 stations of 4x4 sensor array, sensor size 6x6 cm2
- ** v18a: 2 stations of 3x3 sensor array, sensor size 6x6 cm2
- **
- ** v15b: introduce modified carbon ladders from v13z
- ** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
- **
- ** TODO:
- **
- ** DONE:
- ** v15b - use carbon macaroni as ladder support
- ** v15b - introduce a small gap between lowest sensor and carbon ladder
- ** v15b - build small cones for the first 2 stations
- ** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
- ** v15b - for all ladders set an even number of ladder elements 
- ** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
- ** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
- ** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
- **
- ** The geometry hierarachy is:
- **
- ** 1. Sensors  (see function CreateSensors)
- **    The sensors are the active volumes and the lowest geometry level.
- **    They are built as TGeoVolumes, shape box, material silicon.
- **    x size is determined by strip pitch 58 mu and 1024 strips 
- **    plus guard ring of 1.3 mm at each border -> 6.1992 cm.
- **    Sensor type 1 is half of that (3.0792 cm).
- **    y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
- **    guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
- **    z size is a parameter, to be set by gkSensorThickness.
- **
- ** 2. Sectors  (see function CreateSectors)
- **    Sectors consist of several chained sensors. These are arranged
- **    vertically on top of each other with a gap to be set by
- **    gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
- **    The sectors are auxiliary volumes used for proper placement
- **    of the sensor(s) in the module. They do not show up in the
- **    final geometry.
- **
- ** 3. Modules (see function ConstructModule)
- **    A module is a readout unit, consisting of one sensor or
- **    a chain of sensors (see sector) and a cable.
- **    The cable extends from the top of the sector vertically to the
- **    top of the halfladder the module is placed in. The cable and module
- **    volume thus depend on the vertical position of the sector in 
- **    the halfladder. The cables consist of silicon with a thickness to be
- **    set by gkCableThickness.
- **    Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
- **    The module construction can be switched off (gkConstructCables)
- **    to reproduce older geometries.
- **
- ** 4. Halfladders (see function ConstructHalfLadder)
- **    A halfladder is a vertical assembly of several modules. The modules
- **    are placed vertically such that their sectors overlap by 
- **    gkSectorOverlapY. They are displaced in z direction to allow for the 
- **    overlap in y by gkSectorGapZ.
- **    The horizontal placement of modules in the halfladder can be choosen
- **    to left aligned or right aligned, which only matters if sensors of
- **    different x size are involved.
- **    Halfladders are constructed as TGeoVolumeAssembly.
- **
- ** 5. Ladders (see function CreateLadders and ConstructLadder)
- **    A ladder is a vertical assembly of two halfladders, and is such the
- **    vertical building block of a station. The second (bottom) half ladder
- **    is rotated upside down. The vertical arrangement is such that the
- **    inner sectors of the two halfladders have the overlap gkSectorOverlapY
- **    (function CreateLadder) or that there is a vertical gap for the beam
- **    hole (function CreateLadderWithGap).
- **    Ladders are constructed as TGeoVolumeAssembly.
- **   
- ** 6. Stations (see function ConstructStation)
- **    A station represents one layer of the STS geometry: one measurement
- **    at (approximately) a given z position. It consist of several ladders
- **    arranged horizontally to cover the acceptance.
- **    The ladders are arranged such that there is a horizontal overlap
- **    between neighbouring ladders (gkLadderOverLapX) and a vertical gap
- **    to allow for this overlap (gkLadderGapZ). Each second ladder is
- **    rotated around its y axis to face away from or into the beam.
- **    Stations are constructed as TGeoVolumes, shape box minus tube (for
- **    the beam hole), material gStsMedium.
- **
- ** 7. STS
- **    The STS is a volume hosting the entire detectors system. It consists
- **    of several stations located at different z positions.
- **    The STS is constructed as TGeoVolume, shape box minus cone (for the
- **    beam pipe), material gStsMedium. The size of the box is computed to
- **    enclose all stations.
- *****************************************************************************/
-
-
-// Remark: With the proper steering variables, this should exactly reproduce
-// the geometry version v11b of A. Kotynia's described in the ASCII format.
-// The only exception is a minimal difference in the z position of the
-// sectors/sensors. This is because of ladder types 2 and 4 containing the half
-// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
-// covering the beam hole cannot be transformed into each other by rotations,
-// but only by a reflection. This means they are constructionally different.
-// To avoid introducing another two ladder types, the difference in z position
-// was accepted.
-
-
-// Differences to v12:
-// gkChainGap reduced from 1 mm to 0
-// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
-// gkSectorOverlapY reduced from 3 mm to 2.4 mm
-// New sensor types 05 and 06
-// New sector types 07 and 08
-// Re-definiton of ladders (17 types instead of 8)
-// Re-definiton of station from new ladders
-
-
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoPara.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-
-// -------------   Installation offset      -----------------------------------
-
-// position in x and y agrees within 2 mm to CbmRoot geometry (01.02.2022)
-const Double_t gOffX = 0.0;  // Offset from nominal position
-const Double_t gOffY = 0.0;  // Offset from nominal position
-const Double_t gOffZ = 7.0;  // Offset from nominal position
-
-const Bool_t IncludeBox = false;  // true, if STS box is plotted
-
-// -------------   Steering variables       -----------------------------------
-
-// ---> Horizontal width of sensors [cm]
-const Double_t gkSensorSizeX = 6.2092;
-
-// ---> Thickness of sensors [cm]
-const Double_t gkSensorThickness = 0.03;
-
-// ---> Vertical gap between chained sensors [cm]
-const Double_t gkChainGapY = 0.00;
-
-// ---> Thickness of cables [cm]
-const Double_t gkCableThickness = 0.02;
-
-// ---> Horizontal overlap of neighbouring ladders [cm]
-const Double_t gkLadderOverlapX = 0.25;  // delta X - Oleg CAD 14/05/2020
-
-// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
-const Double_t gkSectorOverlapY = 0.46;  // delta Y - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring sectors in a ladder [cm]
-const Double_t gkSectorGapZ = 0.17;  // gap + thickness = pitch // delta Z pitch = 0.20 - Oleg CAD 14/05/2020
-
-// ---> Gap in z between neighbouring ladders [cm]
-const Double_t gkLadderGapZ = 1.00;  // DEJH -> 0.90 / 0.50
-
-// ---> Gap in z between lowest sector to carbon support structure [cm]
-const Double_t gkSectorGapZFrame = 0.10;
-
-// ---> Switch to construct / not to construct readout cables
-const Bool_t gkConstructCables = kTRUE;
-
-// ---> Switch to construct / not to construct frames
-const Bool_t gkConstructCones       = kFALSE;  // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructFrames      = kTRUE;   // kFALSE;  // switch this false for v15a
-const Bool_t gkConstructSmallFrames = kTRUE;   // kFALSE;
-const Bool_t gkCylindricalFrames    = kTRUE;   // kFALSE;
-
-// ---> Size of the frame
-const Double_t gkFrameThickness     = 0.2;
-const Double_t gkThinFrameThickness = 0.05;
-const Double_t gkFrameStep          = 4.0;  // size of frame cell along y direction
-
-const Double_t gkCylinderDiaInner =
-  0.07;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-const Double_t gkCylinderDiaOuter =
-  0.15;  // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
-
-// ----------------------------------------------------------------------------
-
-
-// --------------   Parameters of beam pipe in the STS region    --------------
-// ---> Needed to compute stations and STS such as to avoid overlaps
-const Double_t gkPipeZ1 = 22.0;
-const Double_t gkPipeR1 = 1.8;
-const Double_t gkPipeZ2 = 50.0;
-const Double_t gkPipeR2 = 1.8;
-const Double_t gkPipeZ3 = 125.0;
-const Double_t gkPipeR3 = 5.5;
-
-//DE const Double_t gkPipeZ1 =  27.0;
-//DE const Double_t gkPipeR1 =   1.05;
-//DE const Double_t gkPipeZ2 = 160.0;
-//DE const Double_t gkPipeR2 =   3.25;
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> STS medium (for every volume except silicon)
-TGeoMedium* gStsMedium = NULL;  // will be set later
-// ---> TGeoManager (too lazy to write out 'Manager' all the time
-TGeoManager* gGeoMan = NULL;  // will be set later
-// ----------------------------------------------------------------------------
-
-Int_t CreateSubplates();
-Int_t CreatePlates();
-Int_t CreateSensors();
-Int_t CreateSectors();
-Int_t CreateLadders();
-void CheckVolume(TGeoVolume* volume);
-void CheckVolume(TGeoVolume* volume, fstream& file);
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
-TGeoVolume* ConstructSmallCone(Double_t coneDz);
-TGeoVolume* ConstructBigCone(Double_t coneDz);
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align);
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ);
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY);
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_stsgeo_v22c(const char* geoTag = "v22c_mcbm")
-{
-
-  // -------   Geometry file name (output)   ----------------------------------
-  TString geoFileName = "sts_";
-  geoFileName         = geoFileName + geoTag + ".geo.root";
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = geoFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "STS geometry created with create_stsgeo_v22c.C" << endl << endl;
-  infoFile << "Global variables: " << endl;
-  infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
-  infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
-  infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
-  infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
-  infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
-  infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
-  if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
-  else
-    infoFile << "No cables" << endl;
-  infoFile << endl;
-  infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
-  infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
-  infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3 << " cm" << endl;
-  // --------------------------------------------------------------------------
-
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> air
-  FairGeoMedium* mAir = geoMedia->getMedium("air");
-  if (!mAir) Fatal("Main", "FairMedium air not found");
-  geoBuild->createMedium(mAir);
-  TGeoMedium* air = gGeoMan->GetMedium("air");
-  if (!air) Fatal("Main", "Medium air not found");
-
-  // ---> silicon
-  FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
-  if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
-  geoBuild->createMedium(mSilicon);
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-  if (!silicon) Fatal("Main", "Medium silicon not found");
-
-  // ---> carbon
-  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
-  geoBuild->createMedium(mCarbon);
-  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  if (!carbon) Fatal("Main", "Medium carbon not found");
-
-  // ---> aluminium
-  FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
-  if (!mAluminium) Fatal("Main", "FairMedium aluminium not found");
-  geoBuild->createMedium(mAluminium);
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-  if (!aluminium) Fatal("Main", "Medium aluminium not found");
-
-  // ---> STScable
-  FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
-  if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
-  geoBuild->createMedium(mSTScable);
-  TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
-  if (!STScable) Fatal("Main", "Medium STScable not found");
-
-  // ---
-  gStsMedium = air;
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("STSgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create media   ------------------------------------------
-  /*
-  cout << endl;
-  cout << "===> Creating media....";
-  cout << CreateMedia();
-  cout << " media created" << endl;
-  TList* media = gGeoMan->GetListOfMedia();
-  for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
-    cout << "Medium " << iMedium << ": " 
-	 << ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
-  }
-  gStsMedium = gGeoMan->GetMedium("air");
-  if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
-  */
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create sensors   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sensors...." << endl << endl;
-  infoFile << endl << "Sensors: " << endl;
-  Int_t nSensors = CreateSensors();
-  for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
-    TString name       = Form("Sensor%02d", iSensor);
-    TGeoVolume* sensor = gGeoMan->GetVolume(name);
-
-    // add color to sensors
-    if (iSensor == 1) sensor->SetLineColor(kYellow);
-    if (iSensor == 2) sensor->SetLineColor(kRed);
-    if (iSensor == 3) sensor->SetLineColor(kBlue);
-    if (iSensor == 4) sensor->SetLineColor(kAzure + 7);
-    if (iSensor == 5) sensor->SetLineColor(kGreen);
-    if (iSensor == 6) sensor->SetLineColor(kYellow);
-
-    CheckVolume(sensor);
-    CheckVolume(sensor, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create sectors   --------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating sectors...." << endl;
-  infoFile << endl << "Sectors: " << endl;
-  Int_t nSectors = CreateSectors();
-  for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
-    cout << endl;
-    TString name       = Form("Sector%02d", iSector);
-    TGeoVolume* sector = gGeoMan->GetVolume(name);
-    CheckVolume(sector);
-    CheckVolume(sector, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create ladders   --------------------------------------
-  TString name = "";
-  cout << endl << endl;
-  cout << "===> Creating ladders...." << endl;
-  infoFile << endl << "Ladders:" << endl;
-  Int_t nLadders = CreateLadders();
-  for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
-    cout << endl;
-    name               = Form("Ladder%02d", iLadder);
-    TGeoVolume* ladder = gGeoMan->GetVolume(name);
-    CheckVolume(ladder);
-    CheckVolume(ladder, infoFile);
-    CheckVolume(ladder->GetNode(0)->GetVolume(), infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create cone   -----------------------------------------
-  Double_t coneDz            = 1.64;
-  TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
-  if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
-  TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
-  if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
-  // --------------------------------------------------------------------------
-
-
-  // ----------------   Create stations   -------------------------------------
-  //  Float_t statPos[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
-  Float_t statPos[8] = {28., 42., 50., 60., 70., 80., 90., 100.};
-  //  Float_t statPos[8] = {30., 45., 50., 60., 70., 80., 90., 100.};
-
-  cout << endl << endl;
-  cout << "===> Creating stations...." << endl;
-  infoFile << endl << "Stations: ";
-  nLadders = 0;
-  Int_t ladderTypes[20];
-  Double_t statZ             = 0.;
-  Double_t rHole             = 0.;
-  TGeoBBox* statShape        = NULL;
-  TGeoTranslation* statTrans = NULL;
-
-
-  // --- Station 01: 8 ladders, type 3 2 2 1 1 2 2 3
-  cout << endl;
-  statZ                 = 30.;
-  rHole                 = 2.0;
-  nLadders              = 2;
-  ladderTypes[0]        = 9;
-  ladderTypes[1]        = 9;
-  TGeoVolume* station01 = ConstructStation(0, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot11 = new TGeoRotation;
-    coneRot11->RotateZ(90);
-    coneRot11->RotateY(180);
-    //    TGeoCombiTrans* conePosRot11 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot11);
-    TGeoCombiTrans* conePosRot11 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot11);
-    station01->AddNode(coneSmallVolum, 1, conePosRot11);
-
-    // downstream
-    TGeoRotation* coneRot12 = new TGeoRotation;
-    coneRot12->RotateZ(90);
-    //    TGeoCombiTrans* conePosRot12 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot12);
-    TGeoCombiTrans* conePosRot12 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot12);
-    station01->AddNode(coneSmallVolum, 2, conePosRot12);
-
-    station01->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station01);
-  CheckVolume(station01, infoFile);
-  infoFile << "Position z = " << statPos[0] << endl;
-
-
-  // --- Station 02: 12 ladders, type 4 3 3 2 2 1 1 2 2 3 3 4
-  cout << endl;
-  statZ                 = 40.;
-  rHole                 = 2.0;
-  nLadders              = 3;
-  ladderTypes[0]        = 10;
-  ladderTypes[1]        = 10;
-  ladderTypes[2]        = 11;  // triple ladder
-  TGeoVolume* station02 = ConstructStation(1, nLadders, ladderTypes, rHole);
-
-  if (gkConstructCones) {
-    // upstream
-    TGeoRotation* coneRot21 = new TGeoRotation;
-    coneRot21->RotateZ(-90);
-    coneRot21->RotateY(180);
-    //    TGeoCombiTrans* conePosRot21 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot21);
-    TGeoCombiTrans* conePosRot21 =
-      new TGeoCombiTrans(name + "conePosRot2", 0., 0., -coneDz - 0.305 - gkLadderGapZ / 2., coneRot21);
-    station02->AddNode(coneSmallVolum, 1, conePosRot21);
-
-    // downstream
-    TGeoRotation* coneRot22 = new TGeoRotation;
-    coneRot22->RotateZ(-90);
-    //    TGeoCombiTrans* conePosRot22 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot22);
-    TGeoCombiTrans* conePosRot22 =
-      new TGeoCombiTrans(name + "conePosRot1", 0., 0., coneDz + 0.305 + gkLadderGapZ / 2., coneRot22);
-    station02->AddNode(coneSmallVolum, 2, conePosRot22);
-
-    station02->GetShape()->ComputeBBox();
-  }
-
-  CheckVolume(station02);
-  CheckVolume(station02, infoFile);
-  infoFile << "Position z = " << statPos[1] << endl;
-
-
-  //  // --- Station 03: 12 ladders, type 8 7 6 6 6 5 5 6 6 6 7 8
-  //  cout << endl;
-  //  statZ = 50.;
-  //  rHole = 2.9;
-  //  nLadders = 12;
-  //  ladderTypes[0]  = 14;  // 34;  // 8;
-  //  ladderTypes[1]  = 13;  // 33;  // 7;
-  //  ladderTypes[2]  = 12;  // 32;  // 6;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[6]  =  3;  // 31;  // 22;   // 5;
-  //  ladderTypes[7]  = 12;  // 32;  // 6;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 13;  // 33;  // 7;
-  //  ladderTypes[11] = 14;  // 34;  // 8;
-  //  TGeoVolume* station03 = ConstructStation(2, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot31 = new TGeoRotation;
-  //    coneRot31->RotateZ(90);
-  //    coneRot31->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot31);
-  //    TGeoCombiTrans* conePosRot31 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot31);
-  //    station03->AddNode(coneBigVolum, 1, conePosRot31);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot32 = new TGeoRotation;
-  //    coneRot32->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot32);
-  //    TGeoCombiTrans* conePosRot32 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot32);
-  //    station03->AddNode(coneBigVolum, 2, conePosRot32);
-  //
-  //    station03->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station03);
-  //  CheckVolume(station03, infoFile);
-  //  infoFile << "Position z = " << statPos[2] << endl;
-  //
-  //
-  //  // --- Station 04: 14 ladders, type 9 8 7 6 6 6 5 5 6 6 7 8 9
-  //  cout << endl;
-  //  statZ = 60.;
-  //  rHole = 2.9;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 15;  // 42;  // 9;
-  //  ladderTypes[1]  = 14;  // 34;  // 8;
-  //  ladderTypes[2]  = 13;  // 33;  // 7;
-  //  ladderTypes[3]  = 12;  // 32;  // 6;
-  //  ladderTypes[4]  = 12;  // 32;  // 6;
-  //  ladderTypes[5]  = 12;  // 32;  // 6;
-  //  ladderTypes[6]  =  4;  // 41;  // 5;
-  //  ladderTypes[7]  =  4;  // 41;  // 5;
-  //  ladderTypes[8]  = 12;  // 32;  // 6;
-  //  ladderTypes[9]  = 12;  // 32;  // 6;
-  //  ladderTypes[10] = 12;  // 32;  // 6;
-  //  ladderTypes[11] = 13;  // 33;  // 7;
-  //  ladderTypes[12] = 14;  // 34;  // 8;
-  //  ladderTypes[13] = 15;  // 42;  // 9;
-  //  TGeoVolume* station04 = ConstructStation(3, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot41 = new TGeoRotation;
-  //    coneRot41->RotateZ(-90);
-  //    coneRot41->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot41);
-  //    TGeoCombiTrans* conePosRot41 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot41);
-  //    station04->AddNode(coneBigVolum, 1, conePosRot41);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot42 = new TGeoRotation;
-  //    coneRot42->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot42);
-  //    TGeoCombiTrans* conePosRot42 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot42);
-  //    station04->AddNode(coneBigVolum, 2, conePosRot42);
-  //
-  //    station04->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station04);
-  //  CheckVolume(station04, infoFile);
-  //  infoFile << "Position z = " << statPos[3] << endl;
-  //
-  //
-  //  // --- Station 05: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 70.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  //  55;  // 14;
-  //  ladderTypes[1]  = 18;  //  54;  // 13;
-  //  ladderTypes[2]  = 17;  //  53;  // 12;
-  //  ladderTypes[3]  = 17;  //  53;  // 12;
-  //  ladderTypes[4]  = 16;  //  52;  // 11;
-  //  ladderTypes[5]  = 16;  //  52;  // 11;
-  //  ladderTypes[6]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[7]  =  5;  //  51;  // 23;   // 10;
-  //  ladderTypes[8]  = 16;  //  52;  // 11;
-  //  ladderTypes[9]  = 16;  //  52;  // 11;
-  //  ladderTypes[10] = 17;  //  53;  // 12;
-  //  ladderTypes[11] = 17;  //  53;  // 12;
-  //  ladderTypes[12] = 18;  //  54;  // 13;
-  //  ladderTypes[13] = 19;  //  55;  // 14;
-  //  TGeoVolume* station05 = ConstructStation(4, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot51 = new TGeoRotation;
-  //    coneRot51->RotateZ(90);
-  //    coneRot51->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot51);
-  //    TGeoCombiTrans* conePosRot51 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot51);
-  //    station05->AddNode(coneBigVolum, 1, conePosRot51);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot52 = new TGeoRotation;
-  //    coneRot52->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot52);
-  //    TGeoCombiTrans* conePosRot52 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot52);
-  //    station05->AddNode(coneBigVolum, 2, conePosRot52);
-  //
-  //    station05->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station05);
-  //  CheckVolume(station05, infoFile);
-  //  infoFile << "Position z = " << statPos[4] << endl;
-  //
-  //
-  //  // --- Station 06: 14 ladders, type 14 13 12 12 11 11 10 10 11 11 12 12 13 14
-  //  cout << endl;
-  //  statZ = 80.;
-  //  rHole = 3.7;
-  //  nLadders = 14;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 18;  // 54;  // 13;
-  //  ladderTypes[2]  = 17;  // 53;  // 12;
-  //  ladderTypes[3]  = 17;  // 53;  // 12;
-  //  ladderTypes[4]  = 16;  // 52;  // 11;
-  //  ladderTypes[5]  = 16;  // 52;  // 11;
-  //  ladderTypes[6]  =  6;  // 61;  // 10;
-  //  ladderTypes[7]  =  6;  // 61;  // 10;
-  //  ladderTypes[8]  = 16;  // 52;  // 11;
-  //  ladderTypes[9]  = 16;  // 52;  // 11;
-  //  ladderTypes[10] = 17;  // 53;  // 12;
-  //  ladderTypes[11] = 17;  // 53;  // 12;
-  //  ladderTypes[12] = 18;  // 54;  // 13;
-  //  ladderTypes[13] = 19;  // 55;  // 14;
-  //  TGeoVolume* station06 = ConstructStation(5, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot61 = new TGeoRotation;
-  //    coneRot61->RotateZ(-90);
-  //    coneRot61->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot61);
-  //    TGeoCombiTrans* conePosRot61 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot61);
-  //    station06->AddNode(coneBigVolum, 1, conePosRot61);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot62 = new TGeoRotation;
-  //    coneRot62->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot62);
-  //    TGeoCombiTrans* conePosRot62 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot62);
-  //    station06->AddNode(coneBigVolum, 2, conePosRot62);
-  //
-  //    station06->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station06);
-  //  CheckVolume(station06, infoFile);
-  //  infoFile << "Position z = " << statPos[5] << endl;
-  //
-  //
-  //  // --- Station 07: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 90.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 21;  // 73;  // 17;
-  //  ladderTypes[1]  = 19;  // 55;  // 14;
-  //  ladderTypes[2]  = 18;  // 54;  // 13;
-  //  ladderTypes[3]  = 20;  // 72;  // 16;
-  //  ladderTypes[4]  = 20;  // 72;  // 16;
-  //  ladderTypes[5]  = 20;  // 72;  // 16;
-  //  ladderTypes[6]  = 20;  // 72;  // 16;
-  //  ladderTypes[7]  =  7;  // 71;  // 15;
-  //  ladderTypes[8]  =  7;  // 71;  // 15;
-  //  ladderTypes[9]  = 20;  // 72;  // 16;
-  //  ladderTypes[10] = 20;  // 72;  // 16;
-  //  ladderTypes[11] = 20;  // 72;  // 16;
-  //  ladderTypes[12] = 20;  // 72;  // 16;
-  //  ladderTypes[13] = 18;  // 54;  // 13;
-  //  ladderTypes[14] = 19;  // 55;  // 14;
-  //  ladderTypes[15] = 21;  // 73;  // 17;
-  //  TGeoVolume* station07 = ConstructStation(6, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot71 = new TGeoRotation;
-  //    coneRot71->RotateZ(90);
-  //    coneRot71->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot71);
-  //    TGeoCombiTrans* conePosRot71 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot71);
-  //    station07->AddNode(coneBigVolum, 1, conePosRot71);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot72 = new TGeoRotation;
-  //    coneRot72->RotateZ(90);
-  //    //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot72);
-  //    TGeoCombiTrans* conePosRot72 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot72);
-  //    station07->AddNode(coneBigVolum, 2, conePosRot72);
-  //
-  //    station07->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station07);
-  //  CheckVolume(station07, infoFile);
-  //  infoFile << "Position z = " << statPos[6] << endl;
-  //
-  //
-  //  // --- Station 08: 16 ladders, type 14 13 17 17 16 16 16 15 15 16 16 16 17 17 13 14
-  //  cout << endl;
-  //  statZ = 100.;
-  //  rHole = 4.2;
-  //  nLadders = 16;
-  //  ladderTypes[0]  = 19;  // 55;  // 14;
-  //  ladderTypes[1]  = 17;  // 53;  // 12;
-  //  ladderTypes[2]  = 23;  // 83;  // 20;
-  //  ladderTypes[3]  = 22;  // 82;  // 19;
-  //  ladderTypes[4]  = 22;  // 82;  // 19;
-  //  ladderTypes[5]  = 22;  // 82;  // 19;
-  //  ladderTypes[6]  = 22;  // 82;  // 19;
-  //  ladderTypes[7]  =  8;  // 81;  // 18;
-  //  ladderTypes[8]  =  8;  // 81;  // 18;
-  //  ladderTypes[9]  = 22;  // 82;  // 19;
-  //  ladderTypes[10] = 22;  // 82;  // 19;
-  //  ladderTypes[11] = 22;  // 82;  // 19;
-  //  ladderTypes[12] = 22;  // 82;  // 19;
-  //  ladderTypes[13] = 23;  // 83;  // 20;
-  //  ladderTypes[14] = 17;  // 53;  // 12;
-  //  ladderTypes[15] = 19;  // 55;  // 14;
-  //  TGeoVolume* station08 = ConstructStation(7, nLadders, ladderTypes, rHole);
-  //
-  //  if (gkConstructCones) {
-  //    // upstream
-  //    TGeoRotation* coneRot81 = new TGeoRotation;
-  //    coneRot81->RotateZ(-90);
-  //    coneRot81->RotateY(180);
-  //    //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.3-gkLadderGapZ/2., coneRot81);
-  //    TGeoCombiTrans* conePosRot81 = new TGeoCombiTrans(name+"conePosRot2", 0., 0., -coneDz-0.285-gkLadderGapZ/2., coneRot81);
-  //    station08->AddNode(coneBigVolum, 1, conePosRot81);
-  //
-  //    // downstream
-  //    TGeoRotation* coneRot82 = new TGeoRotation;
-  //    coneRot82->RotateZ(-90);
-  //    //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.3+gkLadderGapZ/2., coneRot82);
-  //    TGeoCombiTrans* conePosRot82 = new TGeoCombiTrans(name+"conePosRot1", 0., 0., coneDz+0.285+gkLadderGapZ/2., coneRot82);
-  //    station08->AddNode(coneBigVolum, 2, conePosRot82);
-  //
-  //    station08->GetShape()->ComputeBBox();
-  //  }
-  //
-  //  CheckVolume(station08);
-  //  CheckVolume(station08, infoFile);
-  //  infoFile << "Position z = " << statPos[7] << endl;
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create subplates   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating subplates...." << endl << endl;
-  infoFile << endl << "Subplates: " << endl;
-  Int_t nSubplates = CreateSubplates();
-  for (Int_t iSubplate = 1; iSubplate <= nSubplates; iSubplate++) {
-    TString name         = Form("Subplate%02d", iSubplate);
-    TGeoVolume* subplate = gGeoMan->GetVolume(name);
-
-    // add color to plates
-    subplate->SetTransparency(60);
-    if (iSubplate == 1) subplate->SetLineColor(kOrange);  // kOrange);
-    if (iSubplate == 2) subplate->SetLineColor(kOrange);  // kRed);
-    if (iSubplate == 3) subplate->SetLineColor(kOrange);  // kGreen);
-
-    if (iSubplate == 4) subplate->SetLineColor(kOrange);  // kRed);
-    if (iSubplate == 5) subplate->SetLineColor(kOrange);  // kOrange);
-    if (iSubplate == 6) subplate->SetLineColor(kOrange);  // kCyan);
-
-    if (iSubplate == 7) subplate->SetLineColor(kOrange);  // kRed);
-
-    if (iSubplate == 8) subplate->SetLineColor(kOrange);   // kGreen);
-    if (iSubplate == 9) subplate->SetLineColor(kOrange);   // kGreen);
-    if (iSubplate == 10) subplate->SetLineColor(kOrange);  // kGreen);
-
-    //    CheckVolume(plate);
-    //    CheckVolume(plate, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-  // ---------------   Create plates   ---------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating plates...." << endl << endl;
-  infoFile << endl << "Plates: " << endl;
-  Int_t nPlates = CreatePlates();
-  for (Int_t iPlate = 1; iPlate <= nPlates; iPlate++) {
-    TString name      = Form("Plate%02d", iPlate);
-    TGeoVolume* plate = gGeoMan->GetVolume(name);
-    //    CheckVolume(plate);
-    //    CheckVolume(plate, infoFile);
-  }
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Create STS volume   ------------------------------------
-  cout << endl << endl;
-  cout << "===> Creating STS...." << endl;
-
-  TString stsName = "sts_";
-  stsName += geoTag;
-
-  // --- Determine size of STS box
-  Double_t stsX      = 0.;
-  Double_t stsY      = 0.;
-  Double_t stsZ      = 0.;
-  Double_t stsBorder = 2 * 5.;  // 5 cm space for carbon ladders on each side
-  Int_t nStation     = 2;       // set number of stations
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName    = Form("Station%02d", iStation);
-    TGeoVolume* station = gGeoMan->GetVolume(statName);
-    TGeoBBox* shape     = (TGeoBBox*) station->GetShape();
-    stsX                = TMath::Max(stsX, 2. * shape->GetDX());
-    stsY                = TMath::Max(stsY, 2. * shape->GetDY());
-    cout << "Station " << iStation << ":  Y " << stsY << endl;
-  }
-  // --- Some border around the stations
-  stsX += stsBorder;
-  stsY += stsBorder;
-  stsZ             = (statPos[1] - statPos[0]) + stsBorder;
-  Double_t stsPosZ = 0.5 * (statPos[1] + statPos[0]);
-
-  // --- Create box  around the stations
-  TGeoBBox* stsBox = new TGeoBBox("stsBox", stsX / 2., stsY / 2., stsZ / 2.);
-  cout << "size of STS box: x " << stsX << " - y " << stsY << " - z " << stsZ << endl;
-
-  //  // --- Create cone hosting the beam pipe
-  //  // --- One straight section with constant radius followed by a cone
-  //  Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //  Double_t z2 = gkPipeZ2;
-  //  Double_t z3 = statPos[1] + 0.5 * stsBorder;  // end of STS box
-  //  Double_t r1 = BeamPipeRadius(z1);
-  //  Double_t r2 = BeamPipeRadius(z2);
-  //  Double_t r3 = BeamPipeRadius(z3);
-  //  r1 += 0.01;    // safety margin
-  //  r2 += 0.01;    // safety margin
-  //  r3 += 0.01;    // safety margin
-  //
-  //  cout << endl;
-  //  cout << z1 << "  " << r1 << endl;
-  //  cout << z2 << "  " << r2 << endl;
-  //  cout << z3 << "  " << r3 << endl;
-  //
-  //  cout << endl;
-  //  cout << "station1 :  " << BeamPipeRadius(statPos[0]) << endl;
-  //  cout << "station2 :  " << BeamPipeRadius(statPos[1]) << endl;
-  //  cout << "station3 :  " << BeamPipeRadius(statPos[2]) << endl;
-  //  cout << "station4 :  " << BeamPipeRadius(statPos[3]) << endl;
-  //  cout << "station5 :  " << BeamPipeRadius(statPos[4]) << endl;
-  //  cout << "station6 :  " << BeamPipeRadius(statPos[5]) << endl;
-  //  cout << "station7 :  " << BeamPipeRadius(statPos[6]) << endl;
-  //  cout << "station8 :  " << BeamPipeRadius(statPos[7]) << endl;
-  //
-  //  //  TGeoPcon* cutout = new TGeoPcon("stsCone", 0., 360., 3); // 2.*TMath::Pi(), 3);
-  //  //  cutout->DefineSection(0, z1, 0., r1);
-  //  //  cutout->DefineSection(1, z2, 0., r2);
-  //  //  cutout->DefineSection(2, z3, 0., r3);
-  //  new TGeoTrd2("stsCone1", r1, r2, r1, r2, (z2-z1)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans1 = new TGeoTranslation("trans1", 0., 0., -(z3-z1)/2.+(z2-z1)/2.);
-  //  trans1->RegisterYourself();
-  //  new TGeoTrd2("stsCone2", r2, r3, r2, r3, (z3-z2)/2.+.1);  // add .1 in z length for a clean cutout
-  //  TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0., 0., +(z3-z1)/2.-(z3-z2)/2.);
-  //  trans2->RegisterYourself();
-
-  //DE   Double_t z1 = statPos[0] - 0.5 * stsBorder;  // start of STS box
-  //DE   Double_t z2 = statPos[7] + 0.5 * stsBorder;  // end of STS box
-  //DE   Double_t slope = (gkPipeR2 - gkPipeR1) / (gkPipeZ2 - gkPipeZ1);
-  //DE   Double_t r1 = gkPipeR1 + slope * (z1 - gkPipeZ1); // at start of STS
-  //DE   Double_t r2 = gkPipeR1 + slope * (z2 - gkPipeZ1); // at end of STS
-  //DE   r1 += 0.1;    // safety margin
-  //DE   r2 += 0.1;    // safety margin
-  //DE   //  new TGeoCone("stsCone", stsZ/2., 0., r1, 0., r2);
-  //DE   new TGeoTrd2("stsCone", r1, r2, r1, r2, stsZ/2.);
-
-  // --- Create STS volume
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape",
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());  // do not produce keeping volumes
-
-  // --- Place stations in the STS
-  for (Int_t iStation = 1; iStation <= nStation; iStation++) {
-    TString statName       = Form("Station%02d", iStation);
-    TGeoVolume* station    = gGeoMan->GetVolume(statName);
-    Double_t posZ          = statPos[iStation - 1] - stsPosZ;
-    TGeoTranslation* trans = new TGeoTranslation(0., 0., posZ);  // standard
-    sts->AddNode(station, iStation, trans);
-    sts->GetShape()->ComputeBBox();
-  }
-
-
-  // plates
-  if (IncludeBox)
-    for (Int_t iPlate = 1; iPlate <= nPlates; iPlate++) {
-      TString platName  = Form("Plate%02d", iPlate);
-      TGeoVolume* plate = gGeoMan->GetVolume(platName);
-      sts->AddNode(plate, iPlate);
-      sts->GetShape()->ComputeBBox();
-    }
-
-  cout << endl;
-  CheckVolume(sts);
-  // --------------------------------------------------------------------------
-
-
-  // ---------------   Finish   -----------------------------------------------
-  TGeoTranslation* stsTrans = new TGeoTranslation(gOffX, gOffY, stsPosZ + gOffZ);
-  top->AddNode(sts, 1, stsTrans);
-  top->GetShape()->ComputeBBox();
-  cout << endl << endl;
-  CheckVolume(top);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* geoFile = new TFile(geoFileName, "RECREATE");
-  sts->Export(geoFileName);
-  cout << endl;
-  cout << "Geometry " << sts->GetName() << " exported to " << geoFileName << endl;
-  geoFile->Close();
-
-  geoFile = new TFile(geoFileName, "UPDATE");
-  stsTrans->Write();
-  geoFile->Close();
-
-  TString geoFileName_ = "sts_";
-  geoFileName_         = geoFileName_ + geoTag + "_geo.root";
-
-  geoFile = new TFile(geoFileName_, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  geoFile->Close();
-
-  top->Draw("ogl");
-  gGeoManager->SetVisLevel(6);
-
-  infoFile.close();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-// ****************************************************************************
-// *****      Definition of media, sensors, sectors and ladders           *****
-// *****                                                                  *****
-// *****     Decoupled from main function for better readability          *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Create media
- **
- ** Currently created: air, active silicon, passive silion
- **
- ** Not used for the time being
- **/
-Int_t CreateMedia()
-{
-
-  Int_t nMedia     = 0;
-  Double_t density = 0.;
-
-  // --- Material air
-  density             = 1.205e-3;  // [g/cm^3]
-  TGeoMixture* matAir = new TGeoMixture("sts_air", 3, density);
-  matAir->AddElement(14.0067, 7, 0.755);  // Nitrogen
-  matAir->AddElement(15.999, 8, 0.231);   // Oxygen
-  matAir->AddElement(39.948, 18, 0.014);  // Argon
-
-  // --- Material silicon
-  density             = 2.33;  // [g/cm^3]
-  TGeoElement* elSi   = gGeoMan->GetElementTable()->GetElement(14);
-  TGeoMaterial* matSi = new TGeoMaterial("matSi", elSi, density);
-
-
-  // --- Air (passive)
-  TGeoMedium* medAir = new TGeoMedium("air", nMedia++, matAir);
-  medAir->SetParam(0, 0.);     // is passive
-  medAir->SetParam(1, 1.);     // is in magnetic field
-  medAir->SetParam(2, 20.);    // max. field [kG]
-  medAir->SetParam(6, 0.001);  // boundary crossing precision [cm]
-
-
-  // --- Active silicon for sensors
-  TGeoMedium* medSiAct = new TGeoMedium("silicon", nMedia++, matSi);
-  medSiAct->SetParam(0, 1.);     // is active
-  medSiAct->SetParam(1, 1.);     // is in magnetic field
-  medSiAct->SetParam(2, 20.);    // max. field [kG]
-  medSiAct->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  // --- Passive silicon for cables
-  TGeoMedium* medSiPas = new TGeoMedium("carbon", nMedia++, matSi);
-  medSiPas->SetParam(0, 0.);     // is passive
-  medSiPas->SetParam(1, 1.);     // is in magnetic field
-  medSiPas->SetParam(2, 20.);    // max. field [kG]
-  medSiPas->SetParam(6, 0.001);  // boundary crossing precisison [cm]
-
-  return nMedia;
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-Int_t CreateSubplates()
-{
-
-  Int_t nSubplates = 0;
-
-  Double_t xSize        = 0.;
-  Double_t ySize        = 0.;
-  Double_t zSize        = 0.5;  // cm  // gkSubplateThickness;
-  TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
-
-  // xsize 830 / (830 - 115+137-12) = 590
-
-  // ysize 518 / 222 / 125 = 865
-  // ysize 530 / 198 / 137   // corrected for 12 mm rim
-
-  // center z-axis in front cutout
-  // ysize 518 + 222/2. = 629
-  // ysize 530 + 198/2. = 629
-
-  // center z-axis in front cutout
-  // xsize 830/2. - (115 + 137)/2. = 415 - 126 = 289
-
-  // ---  Subplate type 01: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 53.0;  // cm
-  TGeoBBox* shape_subplate01 = new TGeoBBox("subplate01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate01", shape_subplate01, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 02: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 59.0;  // cm
-  ySize                      = 19.8;  // cm
-  TGeoBBox* shape_subplate02 = new TGeoBBox("subplate02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate02", shape_subplate02, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 03: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 13.7;  // cm
-  TGeoBBox* shape_subplate03 = new TGeoBBox("subplate03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate03", shape_subplate03, aluminium);
-  nSubplates++;
-
-  // xsize 830 / (830 - 340 - 25) = 465
-  // ysize 483 / 293 / 89 = 865
-
-  // center z-axis in back cutout
-  // ysize 483 + 293/2. = 629.5
-
-  // center z-axis in backside cutout
-  // xsize 830/2. - ( 340/2. + 25 ) = 415 - 220 = 195
-
-  // ---  Subplate type 04: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 48.3;  // cm
-  TGeoBBox* shape_subplate04 = new TGeoBBox("subplate04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate04", shape_subplate04, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 05: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 46.5;  // cm
-  ySize                      = 29.3;  // cm
-  TGeoBBox* shape_subplate05 = new TGeoBBox("subplate05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate05", shape_subplate05, aluminium);
-  nSubplates++;
-
-  // ---  Subplate type 06: front plate (83.0 cm x 86.5 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 8.9;   // cm
-  TGeoBBox* shape_subplate06 = new TGeoBBox("subplate06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Subplate06", shape_subplate06, aluminium);
-  nSubplates++;
-
-  // bottom / top
-  // ---  Subplate type 07: bottom/top plate (83.0 cm x 34.0 cm)
-  xSize                      = 83.0;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate07 = new TGeoBBox("subplate07", xSize / 2., zSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate07", shape_subplate07, aluminium);
-  nSubplates++;
-
-  // right
-  // ---  Subplate type 08: right plate
-  xSize                      = 85.5;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate08 = new TGeoBBox("subplate08", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate08", shape_subplate08, aluminium);
-  nSubplates++;
-
-  // left bottom
-  // ---  Subplate type 09: left plate
-  xSize                      = 52.5;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate09 = new TGeoBBox("subplate09", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate09", shape_subplate09, aluminium);
-  nSubplates++;
-
-  // left top
-  // ---  Subplate type 10: left plate
-  xSize                      = 13.2;  // cm
-  ySize                      = 34.0;  // cm
-  TGeoBBox* shape_subplate10 = new TGeoBBox("subplate10", zSize / 2., xSize / 2., ySize / 2.);
-  new TGeoVolume("Subplate10", shape_subplate10, aluminium);
-  nSubplates++;
-
-  return nSubplates;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-Int_t CreatePlates()
-{
-
-  Int_t nPlates = 0;
-
-  Double_t box_dx = 83.0;  // cm
-  Double_t box_dy = 86.5;  // cm
-
-  //  Double_t dx = 0;  // cm
-  //  Double_t dx = -(box_dx/2 - 19.5);  // cm - backside center
-  //  Double_t dx = -(box_dx/2 - 12.6);  // cm - frontside center
-  Double_t dx = -box_dx / 2 + 15.7;  // cm - from CAD drawing
-
-  Double_t dy = box_dy / 2 - 62.9;  // cm - from CAD drawing 23,6 cm
-
-  //  Double_t box_dz_inner = 0;  // cm
-  Double_t box_dz_inner = 34.0;  // cm
-
-  TGeoVolume* subplate01 = gGeoMan->GetVolume("Subplate01");
-  TGeoVolume* subplate02 = gGeoMan->GetVolume("Subplate02");
-  TGeoVolume* subplate03 = gGeoMan->GetVolume("Subplate03");
-  TGeoBBox* box01        = (TGeoBBox*) subplate01->GetShape();
-  TGeoBBox* box02        = (TGeoBBox*) subplate02->GetShape();
-  TGeoBBox* box03        = (TGeoBBox*) subplate03->GetShape();
-
-  TGeoVolume* subplate04 = gGeoMan->GetVolume("Subplate04");
-  TGeoVolume* subplate05 = gGeoMan->GetVolume("Subplate05");
-  TGeoVolume* subplate06 = gGeoMan->GetVolume("Subplate06");
-  TGeoBBox* box04        = (TGeoBBox*) subplate04->GetShape();
-  TGeoBBox* box05        = (TGeoBBox*) subplate05->GetShape();
-  TGeoBBox* box06        = (TGeoBBox*) subplate06->GetShape();
-
-  TGeoVolume* subplate07 = gGeoMan->GetVolume("Subplate07");
-  TGeoBBox* box07        = (TGeoBBox*) subplate07->GetShape();
-
-  TGeoVolume* subplate08 = gGeoMan->GetVolume("Subplate08");
-  TGeoBBox* box08        = (TGeoBBox*) subplate08->GetShape();
-
-  TGeoVolume* subplate09 = gGeoMan->GetVolume("Subplate09");
-  TGeoBBox* box09        = (TGeoBBox*) subplate09->GetShape();
-
-  TGeoVolume* subplate10 = gGeoMan->GetVolume("Subplate10");
-  TGeoBBox* box10        = (TGeoBBox*) subplate10->GetShape();
-
-  // --- Plate type 1: front plate made of 3 subplates
-  TGeoVolumeAssembly* plate01 = new TGeoVolumeAssembly("Plate01");
-  Double_t sy01               = -box_dy / 2. + box01->GetDY();
-  Double_t sz01               = -(box01->GetDZ() + box_dz_inner / 2.);
-  TGeoTranslation* ty01       = new TGeoTranslation("ty01", dx, sy01 + dy, sz01);
-  plate01->AddNode(subplate01, 1, ty01);
-  Double_t sx02         = -box_dx / 2. + box02->GetDX();
-  Double_t sy02         = -box_dy / 2. + box01->GetDY() * 2 + box02->GetDY();
-  TGeoTranslation* ty02 = new TGeoTranslation("ty02", sx02 + dx, sy02 + dy, sz01);
-  plate01->AddNode(subplate02, 2, ty02);
-  Double_t sy03         = -box_dy / 2. + box01->GetDY() * 2 + box02->GetDY() * 2 + box03->GetDY();
-  TGeoTranslation* ty03 = new TGeoTranslation("ty03", dx, sy03 + dy, sz01);
-  plate01->AddNode(subplate03, 3, ty03);
-  plate01->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 2: back plate made of 3 subplates
-  TGeoVolumeAssembly* plate02 = new TGeoVolumeAssembly("Plate02");
-  Double_t sy04               = -box_dy / 2. + box04->GetDY();
-  Double_t sz04               = box04->GetDZ() + box_dz_inner / 2.;
-  TGeoTranslation* ty04       = new TGeoTranslation("ty04", dx, sy04 + dy, sz04);
-  plate02->AddNode(subplate04, 1, ty04);
-  Double_t sx05         = -box_dx / 2. + box05->GetDX();
-  Double_t sy05         = -box_dy / 2. + box04->GetDY() * 2 + box05->GetDY();
-  TGeoTranslation* ty05 = new TGeoTranslation("ty05", sx05 + dx, sy05 + dy, sz04);
-  plate02->AddNode(subplate05, 2, ty05);
-  Double_t sy06         = -box_dy / 2. + box04->GetDY() * 2 + box05->GetDY() * 2 + box06->GetDY();
-  TGeoTranslation* ty06 = new TGeoTranslation("ty06", dx, sy06 + dy, sz04);
-  plate02->AddNode(subplate06, 3, ty06);
-  plate02->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 3: bottom plate
-  TGeoVolumeAssembly* plate03 = new TGeoVolumeAssembly("Plate03");
-  Double_t sy07               = box_dy / 2. - box07->GetDY();
-  TGeoTranslation* ty07       = new TGeoTranslation("ty07", dx, -sy07 + dy, 0.);
-  plate03->AddNode(subplate07, 1, ty07);
-  plate03->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 4: top plate
-  TGeoVolumeAssembly* plate04 = new TGeoVolumeAssembly("Plate04");
-  TGeoTranslation* ty17       = new TGeoTranslation("ty17", dx, sy07 + dy, 0.);
-  plate04->AddNode(subplate07, 1, ty17);
-  plate04->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 5: -x plate
-  TGeoVolumeAssembly* plate05 = new TGeoVolumeAssembly("Plate05");
-  Double_t sx08               = box_dx / 2. - box08->GetDX();
-  TGeoTranslation* ty08       = new TGeoTranslation("ty08", -sx08 + dx, dy, 0.);
-  plate05->AddNode(subplate08, 1, ty08);
-  plate05->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 6: +x plate (shorted due to beampipe)
-  TGeoVolumeAssembly* plate06 = new TGeoVolumeAssembly("Plate06");
-  Double_t sy09               = -box_dy / 2. + box09->GetDY() + 2 * box09->GetDX();
-  TGeoTranslation* ty09       = new TGeoTranslation("ty09", sx08 + dx, sy09 + dy, 0.);
-  plate06->AddNode(subplate09, 1, ty09);
-  plate06->GetShape()->ComputeBBox();
-  nPlates++;
-
-  // --- Plate type 7: +x plate (shorted due to beampipe)
-  TGeoVolumeAssembly* plate07 = new TGeoVolumeAssembly("Plate07");
-  Double_t sy10               = -box_dy / 2. + box10->GetDY() + 2 * box10->GetDX();
-  TGeoTranslation* ty10       = new TGeoTranslation("ty10", sx08 + dx, -sy10 + dy, 0.);
-  plate07->AddNode(subplate10, 1, ty10);
-  plate07->GetShape()->ComputeBBox();
-  nPlates++;
-
-  return nPlates;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sensors
- **
- ** Sensors are created as volumes with box shape and active silicon as medium.
- ** Four kinds of sensors: 3.2x2.2, 6.2x2.2, 6.2x4.2, 6.2x6.2
- **/
-Int_t CreateSensors()
-{
-
-  Int_t nSensors = 0;
-
-  Double_t xSize      = 0.;
-  Double_t ySize      = 0.;
-  Double_t zSize      = gkSensorThickness;
-  TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
-
-
-  // --- Sensor type 01: Small sensor (6.2 cm x 2.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 2.2;
-  TGeoBBox* shape_sensor01 = new TGeoBBox("sensor01", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor01", shape_sensor01, silicon);
-  nSensors++;
-
-
-  // --- Sensor type 02: Medium sensor (6.2 cm x 4.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor02 = new TGeoBBox("sensor02", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor02", shape_sensor02, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 03: Big sensor (6.2 cm x 6.2 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 6.2;
-  TGeoBBox* shape_sensor03 = new TGeoBBox("sensor03", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor03", shape_sensor03, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 04: Big sensor (6.2 cm x 12.4 cm)
-  xSize                    = gkSensorSizeX;
-  ySize                    = 12.4;
-  TGeoBBox* shape_sensor04 = new TGeoBBox("sensor04", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor04", shape_sensor04, silicon);
-  nSensors++;
-
-
-  // below are extra small sensors, those are not available in the CAD model
-
-  // --- Sensor Type 05: Half small sensor (4 cm x 2.5 cm)
-  xSize                    = 4.0;
-  ySize                    = 2.5;
-  TGeoBBox* shape_sensor05 = new TGeoBBox("sensor05", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor05", shape_sensor05, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 06: Additional "in hole" sensor (3.1 cm x 4.2 cm)
-  xSize                    = 3.1;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor06 = new TGeoBBox("sensor06", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor06", shape_sensor06, silicon);
-  nSensors++;
-
-
-  // ---  Sensor type 07: Mini Medium sensor (1.5 cm x 4.2 cm)
-  xSize                    = 1.5;
-  ySize                    = 4.2;
-  TGeoBBox* shape_sensor07 = new TGeoBBox("sensor07", xSize / 2., ySize / 2., zSize / 2.);
-  new TGeoVolume("Sensor07", shape_sensor07, silicon);
-  nSensors++;
-
-
-  return nSensors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create sectors
- **
- ** A sector is either a single sensor or several chained sensors.
- ** It is implemented as TGeoVolumeAssembly.
- ** Currently available:
- ** - single sensors of type 1 - 4
- ** - two chained sensors of type 4
- ** - three chained sensors of type 4
- **/
-Int_t CreateSectors()
-{
-
-  Int_t nSectors = 0;
-
-  TGeoVolume* sensor01 = gGeoMan->GetVolume("Sensor01");
-  TGeoVolume* sensor02 = gGeoMan->GetVolume("Sensor02");
-  TGeoVolume* sensor03 = gGeoMan->GetVolume("Sensor03");
-  TGeoVolume* sensor04 = gGeoMan->GetVolume("Sensor04");
-  TGeoVolume* sensor05 = gGeoMan->GetVolume("Sensor05");
-  TGeoVolume* sensor06 = gGeoMan->GetVolume("Sensor06");
-  TGeoVolume* sensor07 = gGeoMan->GetVolume("Sensor07");
-  //  TGeoBBox*   box4     = (TGeoBBox*) sensor04->GetShape();
-
-  // --- Sector type 1: single sensor of type 1
-  TGeoVolumeAssembly* sector01 = new TGeoVolumeAssembly("Sector01");
-  sector01->AddNode(sensor01, 1);
-  sector01->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 2: single sensor of type 2
-  TGeoVolumeAssembly* sector02 = new TGeoVolumeAssembly("Sector02");
-  sector02->AddNode(sensor02, 1);
-  sector02->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 3: single sensor of type 3
-  TGeoVolumeAssembly* sector03 = new TGeoVolumeAssembly("Sector03");
-  sector03->AddNode(sensor03, 1);
-  sector03->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 4: single sensor of type 4
-  TGeoVolumeAssembly* sector04 = new TGeoVolumeAssembly("Sector04");
-  sector04->AddNode(sensor04, 1);
-  sector04->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 5: single sensor of type 5
-  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  sector05->AddNode(sensor05, 1);
-  sector05->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 6: single sensor of type 6
-  TGeoVolumeAssembly* sector06 = new TGeoVolumeAssembly("Sector06");
-  sector06->AddNode(sensor06, 1);
-  sector06->GetShape()->ComputeBBox();
-  nSectors++;
-
-  // --- Sector type 7: single sensor of type 7
-  TGeoVolumeAssembly* sector07 = new TGeoVolumeAssembly("Sector07");
-  sector07->AddNode(sensor07, 1);
-  sector07->GetShape()->ComputeBBox();
-  nSectors++;
-
-  //  // --- Sector type 5: two sensors of type 4
-  //  TGeoVolumeAssembly* sector05 = new TGeoVolumeAssembly("Sector05");
-  //  Double_t shift5 = 0.5 * gkChainGapY + box4->GetDY();
-  //  TGeoTranslation* transD5 =
-  //    new TGeoTranslation("td", 0., -1. * shift5, 0.);
-  //  TGeoTranslation* transU5 =
-  //    new TGeoTranslation("tu", 0., shift5, 0.);
-  //  sector05->AddNode(sensor04, 1, transD5);
-  //  sector05->AddNode(sensor04, 2, transU5);
-  //  sector05->GetShape()->ComputeBBox();
-  //  nSectors++;
-
-  return nSectors;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Create ladders
- **
- ** Ladders are the building blocks of the stations. They contain 
- ** several modules placed one after the other along the z axis
- ** such that the sectors are arranged vertically (with overlap).
- ** 
- ** A ladder is constructed out of two half ladders, the second of which
- ** is rotated in the x-y plane by 180 degrees and displaced
- ** in z direction.
- **/
-Int_t CreateLadders()
-{
-
-  Int_t nLadders = 0;
-
-  // --- Some variables
-  Int_t nSectors = 0;
-  Int_t sectorTypes[10];
-  TGeoBBox* shape = NULL;
-  TString s0name;
-  TGeoVolume* s0vol       = NULL;
-  TGeoVolume* halfLadderU = NULL;
-  TGeoVolume* halfLadderD = NULL;
-  Double_t shiftZ         = 0.;
-  Double_t ladderY        = 0.;
-  Double_t gapY           = 0.;
-
-
-  // --- Ladder 01 x-mirror of 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(1, "HalfLadder01u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(1, "HalfLadder01d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(1, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 02: 10 sectors, type 4 4 3 2 1 1 2 3 4 4
-  nSectors       = 5;
-  sectorTypes[0] = 1;
-  sectorTypes[1] = 2;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(2, "HalfLadder02u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(2, "HalfLadder02d", nSectors, sectorTypes, 'r');
-  ConstructLadder(2, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 09: 2 sectors, type 3 3 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(9, "HalfLadder09u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(9, "HalfLadder09d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(9, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 10: 2 sectors, type 3 4 - mSTS
-  nSectors       = 2;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(10, "HalfLadder10u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(10, "HalfLadder10d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(10, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 11: 3 sectors, type 3 3 3 - mSTS
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  //
-  // bottom half ladder only
-  //
-  //  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", nSectors, sectorTypes, 'l');
-  halfLadderU = ConstructHalfLadder(11, "HalfLadder11u", 0, sectorTypes, 'l');
-  halfLadderD = ConstructHalfLadder(11, "HalfLadder11d", nSectors, sectorTypes, 'r');
-  //
-  ConstructLadder(11, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  //=====================================================================================
-
-  // --- Ladder 03 x-mirror of 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(3, "HalfLadder03u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(3, "HalfLadder03d", nSectors, sectorTypes, 'l');  // mirrored
-  ConstructLadder(3, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 04: 10 sectors, type 5 4 3 3 6 6 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 6;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(4, "HalfLadder04u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(4, "HalfLadder04d", nSectors, sectorTypes, 'r');
-  ConstructLadder(4, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 12: 10 sectors, type 5 4 3 3 3 3 3 3 4 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 3;
-  sectorTypes[3] = 4;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(12, "HalfLadder12u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(12, "HalfLadder12d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(12, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 13: 8 sectors, type 5 4 3 3 3 3 4 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  s0name         = Form("Sector%02d", sectorTypes[0]);
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  shiftZ         = 2. * shape->GetDZ() + gkSectorGapZ;
-  halfLadderU    = ConstructHalfLadder(13, "HalfLadder13u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(13, "HalfLadder13d", nSectors, sectorTypes, 'r');
-  ConstructLadder(13, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 14: 6 sensors, type 5 4 3 3 4 5
-  nSectors       = 3;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(14, "HalfLadder14u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(14, "HalfLadder14d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(14, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 15: 4 sectors, type 4 4 4 4
-  nSectors       = 2;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 4;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(15, "HalfLadder15u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(15, "HalfLadder15d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(15, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 05 x-mirror of 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(5, "HalfLadder05u", nSectors, sectorTypes, 'r');  // mirrored
-  halfLadderD    = ConstructHalfLadder(5, "HalfLadder05d", nSectors, sectorTypes, 'l');  // mirrored
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(5, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 06: 10 sectors, type 5 5 4 3 7 7 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 7;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(6, "HalfLadder06u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(6, "HalfLadder06d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(6, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 16: 10 sectors, type 5 5 4 3 3 3 3 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(16, "HalfLadder16u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(16, "HalfLadder16d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(16, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 17: 8 sectors, type 5 5 4 3 3 4 5 5
-  nSectors       = 4;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(17, "HalfLadder17u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(17, "HalfLadder17d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(17, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 18: 6 sectors, type 5 5 4 4 5 5
-  nSectors       = 3;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(18, "HalfLadder18u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(18, "HalfLadder18d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(18, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 19: 4 sectors, type 5 5 5 5
-  nSectors       = 2;
-  sectorTypes[0] = 5;
-  sectorTypes[1] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(19, "HalfLadder19u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(19, "HalfLadder19d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(19, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 07: 10 sectors, type 5 5 4 3 3 gap 3 3 4 5 5, with gap
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(7, "HalfLadder07u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(7, "HalfLadder07d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.4;
-  ConstructLadderWithGap(7, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 20: 10 sectors, type 5 5 5 3 2 2 3 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 2;
-  sectorTypes[1] = 3;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(20, "HalfLadder20u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(20, "HalfLadder20d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(20, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 21: 2 sectors, type 5 5
-  nSectors       = 1;
-  sectorTypes[0] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(21, "HalfLadder21u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(21, "HalfLadder21d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(21, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 08: 8 sectors, type 5 5 5 4 gap 4 5 5 5, with gap
-  nSectors       = 4;
-  sectorTypes[0] = 4;
-  sectorTypes[1] = 5;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(8, "HalfLadder08u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(8, "HalfLadder08d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  gapY           = 4.57;
-  ConstructLadderWithGap(8, halfLadderU, halfLadderD, 2 * gapY);
-  nLadders++;
-
-
-  // --- Ladder 22: 10 sectors, type 5 5 5 4 3 3 4 5 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 5;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(22, "HalfLadder22u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(22, "HalfLadder22d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(22, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-
-  // --- Ladder 23: 10 sectors, type 5 5 4 4 3 3 4 4 5 5
-  nSectors       = 5;
-  sectorTypes[0] = 3;
-  sectorTypes[1] = 4;
-  sectorTypes[2] = 4;
-  sectorTypes[3] = 5;
-  sectorTypes[4] = 5;
-  s0vol          = gGeoMan->GetVolume(s0name);
-  shape          = (TGeoBBox*) s0vol->GetShape();
-  ladderY        = 2. * shape->GetDY();
-  halfLadderU    = ConstructHalfLadder(23, "HalfLadder23u", nSectors, sectorTypes, 'l');
-  halfLadderD    = ConstructHalfLadder(23, "HalfLadder23d", nSectors, sectorTypes, 'r');
-  shape          = (TGeoBBox*) halfLadderU->GetShape();
-  ConstructLadder(23, halfLadderU, halfLadderD, shiftZ);
-  nLadders++;
-
-  return nLadders;
-}
-/** ======================================================================= **/
-
-
-// ****************************************************************************
-// *****                                                                  *****
-// *****    Generic functions  for the construction of STS elements       *****
-// *****                                                                  *****
-// *****  module:     volume (made of a sector and a cable)               *****
-// *****  haf ladder: assembly (made of modules)                          *****
-// *****  ladder:     assembly (made of two half ladders)                 *****
-// *****  station:    volume (made of ladders)                            *****
-// *****                                                                  *****
-// ****************************************************************************
-
-
-/** ===========================================================================
- ** Construct a module
- **
- ** A module is a sector plus the readout cable extending from the
- ** top of the sector. The cable is made from passive silicon.
- ** The cable has the same x size as the sector.
- ** Its thickness is given by the global variable gkCableThickness.
- ** The cable length is a parameter.
- ** The sensor(s) of the sector is/are placed directly in the module;
- ** the sector is just auxiliary for the proper placement.
- **
- ** Arguments: 
- **            name             volume name
- **            sector           pointer to sector volume
- **            cableLength      length of cable
- **/
-TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength)
-{
-
-  // --- Check sector volume
-  if (!sector) Fatal("CreateModule", "Sector volume not found!");
-
-  // --- Get size of sector
-  TGeoBBox* box    = (TGeoBBox*) sector->GetShape();
-  Double_t sectorX = 2. * box->GetDX();
-  Double_t sectorY = 2. * box->GetDY();
-  Double_t sectorZ = 2. * box->GetDZ();
-
-  // --- Get size of cable
-  Double_t cableX = sectorX;
-  Double_t cableY = cableLength;
-  Double_t cableZ = gkCableThickness;
-
-  // --- Create module volume
-  Double_t moduleX   = TMath::Max(sectorX, cableX);
-  Double_t moduleY   = sectorY + cableLength;
-  Double_t moduleZ   = TMath::Max(sectorZ, cableZ);
-  TGeoVolume* module = gGeoManager->MakeBox(name, gStsMedium, moduleX / 2., moduleY / 2., moduleZ / 2.);
-
-  // --- Position of sector in module
-  // --- Sector is centred in x and z and aligned to the bottom
-  Double_t sectorXpos = 0.;
-  Double_t sectorYpos = 0.5 * (sectorY - moduleY);
-  Double_t sectorZpos = 0.;
-
-
-  // --- Get sensor(s) from sector
-  Int_t nSensors = sector->GetNdaughters();
-  for (Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
-    TGeoNode* sensor = sector->GetNode(iSensor);
-
-    // --- Calculate position of sensor in module
-    const Double_t* xSensTrans = sensor->GetMatrix()->GetTranslation();
-    Double_t sensorXpos        = 0.;
-    Double_t sensorYpos        = sectorYpos + xSensTrans[1];
-    Double_t sensorZpos        = 0.;
-    TGeoTranslation* sensTrans = new TGeoTranslation("sensTrans", sensorXpos, sensorYpos, sensorZpos);
-
-    // --- Add sensor volume to module
-    TGeoVolume* sensVol = sensor->GetVolume();
-    module->AddNode(sensor->GetVolume(), iSensor + 1, sensTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-
-  // --- Create cable volume, if necessary, and place it in module
-  // --- Cable is centred in x and z and aligned to the top
-  if (gkConstructCables && cableLength > 0.0001) {
-    TString cableName       = TString(name) + "_cable";
-    TGeoMedium* cableMedium = gGeoMan->GetMedium("STScable");
-    if (!cableMedium) Fatal("CreateModule", "Medium STScable not found!");
-    TGeoVolume* cable = gGeoManager->MakeBox(cableName.Data(), cableMedium, cableX / 2., cableY / 2., cableZ / 2.);
-    // add color to cables
-    cable->SetLineColor(kOrange);
-    cable->SetTransparency(60);
-    Double_t cableXpos          = 0.;
-    Double_t cableYpos          = sectorY + 0.5 * cableY - 0.5 * moduleY;
-    Double_t cableZpos          = 0.;
-    TGeoTranslation* cableTrans = new TGeoTranslation("cableTrans", cableXpos, cableYpos, cableZpos);
-    module->AddNode(cable, 1, cableTrans);
-    module->GetShape()->ComputeBBox();
-  }
-
-  return module;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a half ladder
- **
- ** A half ladder is a virtual volume (TGeoVolumeAssembly) consisting
- ** of several modules arranged on top of each other. The modules
- ** have a given overlap in y and a displacement in z to allow for the
- ** overlap.
- **
- ** The typ of sectors / modules to be placed must be specified:
- **    1 = sensor01
- **    2 = sensor02
- **    3 = sensor03
- **    4 = sensor04
- **    5 = 2 x sensor04 (chained)
- **    6 = 3 x sensor04 (chained)
- ** The cable is added automatically from the top of each sensor to
- ** the top of the half ladder.
- ** The alignment can be left (l) or right (r), which matters in the
- ** case of different x sizes of sensors (e.g. SensorType01).
- **
- ** Arguments: 
- **            name             volume name
- **            nSectors         number of sectors
- **            sectorTypes      array with sector types
- **            align            horizontal alignment of sectors
- **/
-TGeoVolume* ConstructHalfLadder(Int_t ladderid, const TString& name, Int_t nSectors, Int_t* sectorTypes, char align)
-{
-
-  // --- Create half ladder volume assembly
-  TGeoVolumeAssembly* halfLadder = new TGeoVolumeAssembly(name);
-
-  // --- Determine size of ladder
-  Double_t ladderX = 0.;
-  Double_t ladderY = 0.;
-  Double_t ladderZ = 0.;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    if (!sector) Fatal("ConstructHalfLadder", (char*) Form("Volume %s not found", sectorName.Data()));
-    TGeoBBox* box = (TGeoBBox*) sector->GetShape();
-    // --- Ladder x size equals largest sector x size
-    ladderX = TMath::Max(ladderX, 2. * box->GetDX());
-    // --- Ladder y size is sum of sector ysizes
-    ladderY += 2. * box->GetDY();
-    // --- Ladder z size is sum of sector z sizes
-    ladderZ += 2. * box->GetDZ();
-  }
-  // --- Subtract overlaps in y
-  ladderY -= Double_t(nSectors - 1) * gkSectorOverlapY;
-  // --- Add gaps in z direction
-  ladderZ += Double_t(nSectors - 1) * gkSectorGapZ;
-
-
-  // --- Create and place modules
-  Double_t yPosSect = -0.5 * ladderY;
-  Double_t zPosMod  = -0.5 * ladderZ;
-  for (Int_t iSector = 0; iSector < nSectors; iSector++) {
-    TString sectorName = Form("Sector%02d", sectorTypes[iSector]);
-    TGeoVolume* sector = gGeoMan->GetVolume(sectorName);
-    TGeoBBox* box      = (TGeoBBox*) sector->GetShape();
-    Double_t sectorX   = 2. * box->GetDX();
-    Double_t sectorY   = 2. * box->GetDY();
-    Double_t sectorZ   = 2. * box->GetDZ();
-    yPosSect += 0.5 * sectorY;  // Position of sector in ladder
-    Double_t cableLength = 0.5 * ladderY - yPosSect - 0.5 * sectorY;
-    TString moduleName   = name + "_" + Form("Module%02d", sectorTypes[iSector]);
-    TGeoVolume* module   = ConstructModule(moduleName.Data(), sector, cableLength);
-
-    TGeoBBox* shapeMod = (TGeoBBox*) module->GetShape();
-    Double_t moduleX   = 2. * shapeMod->GetDX();
-    Double_t moduleY   = 2. * shapeMod->GetDY();
-    Double_t moduleZ   = 2. * shapeMod->GetDZ();
-    Double_t xPosMod   = 0.;
-    if (align == 'l') xPosMod = 0.5 * (moduleX - ladderX);  // left aligned
-    else if (align == 'r')
-      xPosMod = 0.5 * (ladderX - moduleX);  // right aligned
-    else
-      xPosMod = 0.;                                // centred in x
-    Double_t yPosMod = 0.5 * (ladderY - moduleY);  // top aligned
-    zPosMod += 0.5 * moduleZ;
-    TGeoTranslation* trans = new TGeoTranslation("t", xPosMod, yPosMod, zPosMod);
-    //    // DEDE
-    //    // drop 2nd module on this halfladder for mSTS Nov 2019
-    //    //    halfLadder->AddNode(module, iSector+1, trans);
-    //    if (ladderid == 9) cout << "DE333 " << iSector << endl;
-    //    if (ladderid == 9)
-    //      if (iSector == 0)
-    //        halfLadder->AddNode(module, iSector+1, trans);
-
-    halfLadder->AddNode(module, iSector + 1, trans);
-    halfLadder->GetShape()->ComputeBBox();
-    yPosSect += 0.5 * sectorY - gkSectorOverlapY;
-    zPosMod += 0.5 * moduleZ + gkSectorGapZ;
-  }
-
-  CheckVolume(halfLadder);
-  cout << endl;
-
-  return halfLadder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Add a carbon support to a ladder
- ** 
- ** Arguments: 
- **            LadderIndex      ladder number
- **            ladder           pointer to ladder
- **            xu               size of halfladder
- **            ladderY          height of ladder along y
- **            ladderZ          thickness of ladder along z
- **/
-void AddCarbonLadder(Int_t LadderIndex, TGeoVolume* ladder, Double_t xu, Double_t ladderY, Double_t ladderZ)
-{
-
-  // --- Some variables
-  TString name = Form("Ladder%02d", LadderIndex);
-  Int_t i;
-  Double_t j;
-
-  Int_t YnumOfFrameBoxes = (Int_t)(ladderY / gkFrameStep) + 1;  // calculate number of elements
-  if (LadderIndex == 1 || LadderIndex == 2)  // set even number of ladder elements for these ladders in station 1 and 2
-    YnumOfFrameBoxes--;
-  //  if (LadderIndex == 3 || LadderIndex == 4)  // set even number of ladder elements for these ladders in station 3 and 4
-  //	YnumOfFrameBoxes++;
-  YnumOfFrameBoxes += YnumOfFrameBoxes % 2;  // use even number of frame elements for all ladders
-
-  //      cout << "DE: lad " << LadderIndex << " inum " << YnumOfFrameBoxes << endl;
-
-  // DEDE
-  TGeoBBox* fullFrameShp = new TGeoBBox(name + "_FullFrameBox_shp", xu / 2., gkFrameStep / 2.,
-                                        (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.);
-  //  TGeoBBox* fullFrameShp = new TGeoBBox (name+"_FullFrameBox_shp", xu/2., gkFrameStep/2., (gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2.);
-  TGeoVolume* fullFrameBoxVol = new TGeoVolume(name + "_FullFrameBox", fullFrameShp, gStsMedium);
-
-  //  cout << "DE: frame Z size " << (xu/2.+sqrt(2.)*gkFrameThickness/2.) << " cm" << endl;
-
-  ConstructFrameElement("FrameBox", fullFrameBoxVol, xu / 2.);
-  TGeoRotation* fullFrameRot = new TGeoRotation;
-  fullFrameRot->RotateY(180);
-
-  Int_t inum = YnumOfFrameBoxes;  // 6; // 9;
-  for (i = 1; i <= inum; i++) {
-    j = -(inum - 1) / 2. + (i - 1);
-    //        cout << "DE: i " << i << " j " << j << endl;
-
-    if (LadderIndex <= 2)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -1) && (j <= 1))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-    else if (LadderIndex <= 8)  // central ladders in stations 1 to 8
-    {
-      if ((j >= -2) && (j <= 2))  // keep the inner 4 elements free for the cone
-        continue;
-    }
-
-    // DEDE
-    ladder->AddNode(fullFrameBoxVol, i,
-                    new TGeoCombiTrans(name + "_FullFrameBox_posrot", 0., j * gkFrameStep,
-                                       -ladderZ / 2. - (xu / 2. + sqrt(2.) * gkFrameThickness / 2.) / 2.,
-                                       fullFrameRot));
-    //    ladder->AddNode(fullFrameBoxVol, i, new TGeoCombiTrans(name+"_FullFrameBox_posrot", 0., j*gkFrameStep, -ladderZ/2.-(gkSectorGapZFrame+xu/2.+sqrt(2.)*gkFrameThickness/2.)/2., fullFrameRot));
-  }
-  //      cout << endl;
-  ladder->GetShape()->ComputeBBox();
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical overlap and displaced in z bz shiftZ.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            shiftZ           relative displacement along the z axis
- **/
-
-TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t shiftZ)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  //  Double_t ladderY = yu + yd - gkSectorOverlapY;
-  Double_t ladderY = TMath::Max(yu, yd);
-  Double_t ladderZ = TMath::Max(zu, zd + shiftZ);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD = 0.;                    // centred in x
-  Double_t yPosD = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD = 0.5 * (zd - ladderZ);  // back aligned
-
-  //  cout << "DEEEE: li " <<  LadderIndex
-  //       <<    " || xu " << xu << " yu " << yu << " zu " << zu
-  //       <<    " || xd " << xd << " yd " << yd << " zd " << zd
-  //       <<    " || ypu " << yPosU << " ypd " << yPosD
-  //       << endl;
-
-  if (yu == 0)  // if no top (= only bottom) half ladder
-  {
-    yPosD = 0.5 * (ladderY - yd);  // top aligned
-    zPosD = 0.5 * (ladderZ - zd);  // back aligned
-  }
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames)
-    //      AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);  // take width of top HL
-    AddCarbonLadder(LadderIndex, ladder, ladderX, ladderY, ladderZ);  // take width of any HL
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a ladder out of two half ladders with vertical gap
- ** 
- ** The second half ladder will be rotated by 180 degrees 
- ** in the x-y plane. The two half ladders will be put on top of each
- ** other with a vertical gap.
- **
- ** Arguments: 
- **            name             volume name
- **            halfLadderU      pointer to upper half ladder
- **            halfLadderD      pointer to lower half ladder
- **            gapY             vertical gap
- **/
-
-TGeoVolume* ConstructLadderWithGap(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY)
-{
-
-  // --- Some variables
-  TGeoBBox* shape = NULL;
-  Int_t i;
-  Double_t j;
-
-  // --- Dimensions of half ladders
-  shape       = (TGeoBBox*) halfLadderU->GetShape();
-  Double_t xu = 2. * shape->GetDX();
-  Double_t yu = 2. * shape->GetDY();
-  Double_t zu = 2. * shape->GetDZ();
-
-  shape       = (TGeoBBox*) halfLadderD->GetShape();
-  Double_t xd = 2. * shape->GetDX();
-  Double_t yd = 2. * shape->GetDY();
-  Double_t zd = 2. * shape->GetDZ();
-
-  // --- Create ladder volume assembly
-  TString name               = Form("Ladder%02d", LadderIndex);
-  TGeoVolumeAssembly* ladder = new TGeoVolumeAssembly(name);
-  Double_t ladderX           = TMath::Max(xu, xd);
-  Double_t ladderY           = yu + yd + gapY;
-  Double_t ladderZ           = TMath::Max(zu, zd);
-
-  // --- Place half ladders
-  Double_t xPosU      = 0.;                    // centred in x
-  Double_t yPosU      = 0.5 * (ladderY - yu);  // top aligned
-  Double_t zPosU      = 0.5 * (ladderZ - zu);  // front aligned
-  TGeoTranslation* tu = new TGeoTranslation("tu", xPosU, yPosU, zPosU);
-  ladder->AddNode(halfLadderU, 1, tu);
-
-  Double_t xPosD   = 0.;                    // centred in x
-  Double_t yPosD   = 0.5 * (yd - ladderY);  // bottom aligned
-  Double_t zPosD   = 0.5 * (zd - ladderZ);  // back aligned
-  TGeoRotation* rd = new TGeoRotation();
-  rd->RotateZ(180.);
-  TGeoCombiTrans* cd = new TGeoCombiTrans(xPosD, yPosD, zPosD, rd);
-  ladder->AddNode(halfLadderD, 2, cd);
-  ladder->GetShape()->ComputeBBox();
-
-  // ----------------   Create and place frame boxes   ------------------------
-
-  if (gkConstructFrames) AddCarbonLadder(LadderIndex, ladder, xu, ladderY, ladderZ);
-
-  // --------------------------------------------------------------------------
-
-  return ladder;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Construct a station
- **
- ** The station volume is the minimal  box comprising all ladders
- ** minus a tube accomodating the beam pipe.
- **
- ** The ladders are arranged horizontally from left to right with
- ** a given overlap in x.
- ** Every second ladder is slightly displaced upstream from the centre
- ** z plane and facing downstream, the others are slightly displaced
- ** downstream and facing upstream (rotated around the y axis).
- **
- ** Arguments: 
- **            name             volume name
- **            nLadders         number of ladders
- **            ladderTypes      array of ladder types
- **            rHole            radius of inner hole
- **/
-
-// TGeoVolume* ConstructStation(const char* name,
-//                              Int_t iStation,
-
-TGeoVolume* ConstructStation(Int_t iStation, Int_t nLadders, Int_t* ladderTypes, Double_t rHole)
-{
-
-  TString name;
-  name = Form("Station%02d", iStation + 1);  // 1,2,3,4,5,6,7,8
-  //  name = Form("Station%02d", iStation);  // 0,1,2,3,4,5,6,7 - Station00 missing in output
-
-  // --- Some local variables
-  TGeoShape* statShape  = NULL;
-  TGeoBBox* ladderShape = NULL;
-  TGeoBBox* shape       = NULL;
-  TGeoVolume* ladder    = NULL;
-  TString ladderName;
-
-
-  // --- Determine size of station from ladders
-  Double_t statX     = 0.;
-  Double_t statY     = 0.;
-  Double_t statZeven = 0.;
-  Double_t statZodd  = 0.;
-  Double_t statZ     = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    if (!ladder) Fatal("ConstructStation", Form("Volume %s not found", ladderName.Data()));
-    shape = (TGeoBBox*) ladder->GetShape();
-    statX += 2. * shape->GetDX();
-    statY = TMath::Max(statY, 2. * shape->GetDY());
-    if (iLadder % 2) statZeven = TMath::Max(statZeven, 2. * shape->GetDZ());
-    else
-      statZodd = TMath::Max(statZodd, 2. * shape->GetDZ());
-  }
-  statX -= Double_t(nLadders - 1) * gkLadderOverlapX;
-  statZ = statZeven + gkLadderGapZ + statZodd;
-
-  // --- Create station volume
-  TString boxName(name);
-  boxName += "_box";
-
-  cout << "before   statZ/2.: " << statZ / 2. << endl;
-  statZ = 2 * 4.5;  // changed Z size of the station for cone and gkLadderGapZ
-  cout << "fixed to statZ/2.: " << statZ / 2. << endl;
-  TGeoBBox* statBox = new TGeoBBox(boxName, statX / 2., statY / 2., statZ / 2.);
-
-  //  TString tubName(name);
-  //  tubName += "_tub";
-  //  TString expression = boxName + "-" + tubName;
-  //  //  TGeoTube* statTub = new TGeoTube(tubName, 0., rHole, statZ/2.);
-  //  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.);
-  //  TGeoBBox* statTub = new TGeoBBox(tubName, rHole, rHole, statZ/2.+.1);  // .1 opens the hole in z direction
-  //
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-  //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-  TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);  // do not produce keeping volumes
-
-  Double_t subtractedVal;
-
-  // --- Place ladders in station
-  cout << "xPos0: " << statX << endl;
-  Double_t xPos = -0.5 * statX;
-  cout << "xPos1: " << xPos << endl;
-  Double_t yPos = 0.;
-  Double_t zPos = 0.;
-
-  Double_t maxdz = 0.;
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    if (maxdz < shape->GetDZ()) maxdz = shape->GetDZ();
-  }
-
-  for (Int_t iLadder = 0; iLadder < nLadders; iLadder++) {
-    Int_t ladderType = ladderTypes[iLadder];
-    ladderName       = Form("Ladder%02d", ladderType);
-    ladder           = gGeoManager->GetVolume(ladderName);
-    shape            = (TGeoBBox*) ladder->GetShape();
-    xPos += shape->GetDX();
-    cout << "xPos2: " << xPos << endl;
-    yPos              = 0.;  // vertically centred
-    TGeoRotation* rot = new TGeoRotation();
-
-    if (gkConstructFrames)
-      // DEDE
-      subtractedVal = sqrt(2.) * gkFrameThickness / 2. + shape->GetDX();
-    //      subtractedVal = 2*gkSectorGapZFrame + sqrt(2.)*gkFrameThickness/2. + shape->GetDX();
-    else
-      subtractedVal = 0.;
-
-    //    zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);  // non z-aligned ladders
-    zPos = 0.5 * gkLadderGapZ + (2 * maxdz - shape->GetDZ() - subtractedVal / 2.);  // z-aligned ladders
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  dx: " << shape->GetDX() << "  dy: " << shape->GetDY()
-         << "  dz: " << shape->GetDZ() << "  max dz: " << maxdz << endl;
-
-    cout << "DE ladder" << ladderTypes[iLadder] << "  fra: " << gkFrameThickness / 2. << "  sub: " << subtractedVal
-         << "  zpo: " << zPos << endl
-         << endl;
-
-    //    if (iStation % 2 == 0) // flip ladders for even stations to reproduce CAD layout
-    //    // even station 0,2,4,6
-    if (iStation % 2 == 1)  // flip ladders for odd stations to reproduce CAD layout
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- downstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-      }
-      // --- Rotated ladders --- upstream
-      else {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-    }
-    else
-    // odd station 1,3,5,7
-    {
-      // --- Unrotated ladders --- upstream
-      if ((nLadders / 2 + iLadder) % 2) {
-        //        zPos = -0.5 * gkLadderGapZ - (shape->GetDZ()-subtractedVal/2.);
-        zPos = -zPos;
-      }
-      // --- Rotated ladders --- downstream
-      else {
-        //        zPos = 0.5 * gkLadderGapZ + (shape->GetDZ()-subtractedVal/2.);
-        rot->RotateY(180.);
-        //        zPos += 14.;  // move STS ladder from position of C-frame #1 to C-frame #3 - March 2019 version
-      }
-    }
-
-    TGeoCombiTrans* trans = new TGeoCombiTrans(xPos, yPos, zPos, rot);
-
-    // enable or disable units
-    // Unit 0
-    if ((ladderType == 9) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 1
-    if ((ladderType == 9) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 2
-    if ((ladderType == 10) && (iLadder + 1 == 2)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 right (far from beam)
-    if ((ladderType == 10) && (iLadder + 1 == 1)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // Unit 3 left (close to beam)
-    if ((ladderType == 11) && (iLadder + 1 == 3)) {
-      cout << "including " << ladderName << " " << ladderType << " " << iLadder + 1 << endl;
-      station->AddNode(ladder, iLadder + 1, trans);
-    }
-
-    // include all ladders
-    //      station->AddNode(ladder, iLadder+1, trans);
-
-    //    // drop upstream ladder for mSTS Nov 2019
-    //    //    station->AddNode(ladder, iLadder+1, trans);
-    //    cout << "DE222 " << iLadder << endl;
-    //      if (iLadder == 1) station->AddNode(ladder, iLadder+1, trans);
-
-    station->GetShape()->ComputeBBox();
-    xPos += shape->GetDX() - gkLadderOverlapX;
-    cout << "xPos3: " << xPos << endl;
-  }
-
-  return station;
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for debugging
- **/
-void CheckVolume(TGeoVolume* volume)
-{
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  cout << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) cout << ", assembly";
-  else {
-    if (volume->GetMedium()) cout << ", medium " << volume->GetMedium()->GetName();
-    else
-      cout << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  cout << endl;
-  if (volume->GetNdaughters()) {
-    cout << "Daughters: " << endl;
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++) {
-      TGeoNode* node  = volume->GetNode(iNode);
-      TGeoBBox* shape = (TGeoBBox*) node->GetVolume()->GetShape();
-      cout << setw(15) << node->GetName() << ", size " << fixed << setprecision(3) << setw(6) << 2. * shape->GetDX()
-           << " x " << setw(6) << 2. * shape->GetDY() << " x " << setw(6) << 2. * shape->GetDZ() << ", position ( ";
-      TGeoMatrix* matrix  = node->GetMatrix();
-      const Double_t* pos = matrix->GetTranslation();
-      cout << setfill(' ');
-      cout << fixed << setw(8) << pos[0] << ", " << setw(8) << pos[1] << ", " << setw(8) << pos[2] << " )" << endl;
-    }
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Volume information for output to file
- **/
-void CheckVolume(TGeoVolume* volume, fstream& file)
-{
-
-  if (!file) return;
-
-  TGeoBBox* shape = (TGeoBBox*) volume->GetShape();
-  file << volume->GetName() << ": size " << fixed << setprecision(4) << setw(7) << 2. * shape->GetDX() << " x "
-       << setw(7) << 2. * shape->GetDY() << " x " << setw(7) << 2. * shape->GetDZ();
-  if (volume->IsAssembly()) file << ", assembly";
-  else {
-    if (volume->GetMedium()) file << ", medium " << volume->GetMedium()->GetName();
-    else
-      file << ", "
-           << "\033[31m"
-           << " no medium"
-           << "\033[0m";
-  }
-  file << endl;
-  if (volume->GetNdaughters()) {
-    file << "Contains: ";
-    for (Int_t iNode = 0; iNode < volume->GetNdaughters(); iNode++)
-      file << volume->GetNode(iNode)->GetVolume()->GetName() << " ";
-    file << endl;
-  }
-}
-/** ======================================================================= **/
-
-
-/** ===========================================================================
- ** Calculate beam pipe outer radius for a given z
- **/
-Double_t BeamPipeRadius(Double_t z)
-{
-  if (z < gkPipeZ2) return gkPipeR1;
-  Double_t slope = (gkPipeR3 - gkPipeR2) / (gkPipeZ3 - gkPipeZ2);
-  return gkPipeR2 + slope * (z - gkPipeZ2);
-}
-/** ======================================================================= **/
-
-
-/** ======================================================================= **/
-TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  Double_t t = gkFrameThickness / 2.;
-
-  // --- Main vertical pillars
-  //    	TGeoBBox* frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, gkFrameStep/2., t);  // square crossection, along y
-  //	TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  //	frameVertPillarVol->SetLineColor(kGreen);
-  //	frameBoxVol->AddNode(frameVertPillarVol, 1, new TGeoTranslation(name + "_vertpillar_pos_1", x-t, 0., -(x+sqrt(2.)*t-2.*t)/2.));
-  //	frameBoxVol->AddNode(frameVertPillarVol, 2, new TGeoTranslation(name + "_vertpillar_pos_2", -(x-t), 0., -(x+sqrt(2.)*t-2.*t)/2.));
-
-  TGeoBBox* frameVertPillarShp;
-  if (gkCylindricalFrames)
-    //          TGeoBBox* frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", 0, t, gkFrameStep/2.);  // circle crossection, along z
-    frameVertPillarShp = new TGeoTube(name + "_vertpillar_shape", gkCylinderDiaInner / 2., gkCylinderDiaOuter / 2.,
-                                      gkFrameStep / 2.);  // circle crossection, along z
-  else
-    frameVertPillarShp = new TGeoBBox(name + "_vertpillar_shape", t, t,
-                                      gkFrameStep / 2.);  // square crossection, along z
-  TGeoVolume* frameVertPillarVol = new TGeoVolume(name + "_vertpillar", frameVertPillarShp, framesMaterial);
-  frameVertPillarVol->SetLineColor(kGreen);
-
-  TGeoRotation* xRot90 = new TGeoRotation;
-  xRot90->RotateX(90.);
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 1,
-    new TGeoCombiTrans(name + "_vertpillar_pos_1", x - t, 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-  frameBoxVol->AddNode(
-    frameVertPillarVol, 2,
-    new TGeoCombiTrans(name + "_vertpillar_pos_2", -(x - t), 0., -(x + sqrt(2.) * t - 2. * t) / 2., xRot90));
-
-  //	TGeoRotation* vertRot = new TGeoRotation(name + "_vertpillar_rot_1", 90., 45., -90.);
-  TGeoRotation* vertRot = new TGeoRotation;
-  vertRot->RotateX(90.);
-  vertRot->RotateY(45.);
-  frameBoxVol->AddNode(frameVertPillarVol, 3,
-                       new TGeoCombiTrans(name + "_vertpillar_pos_3", 0., 0., (x - sqrt(2.) * t) / 2., vertRot));
-
-  // --- Small horizontal pillar
-  TGeoBBox* frameHorPillarShp =
-    new TGeoBBox(name + "_horpillar_shape", x - 2. * t, gkThinFrameThickness / 2., gkThinFrameThickness / 2.);
-  TGeoVolume* frameHorPillarVol = new TGeoVolume(name + "_horpillar", frameHorPillarShp, framesMaterial);
-  frameHorPillarVol->SetLineColor(kCyan);
-  frameBoxVol->AddNode(frameHorPillarVol, 1,
-                       new TGeoTranslation(name + "_horpillar_pos_1", 0., -gkFrameStep / 2. + gkThinFrameThickness / 2.,
-                                           -(x + sqrt(2.) * t - 2. * t) / 2.));
-
-  if (gkConstructSmallFrames) {
-
-    // --- Small sloping pillar
-    TGeoPara* frameSlopePillarShp =
-      new TGeoPara(name + "_slopepillar_shape", (x - 2. * t) / TMath::Cos(31.4 / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., 31.4, 0., 90.);
-    TGeoVolume* frameSlopePillarVol = new TGeoVolume(name + "_slopepillar", frameSlopePillarShp, framesMaterial);
-    frameSlopePillarVol->SetLineColor(kCyan);
-    TGeoRotation* slopeRot = new TGeoRotation(name + "_slopepillar_rot_1", 0., 0., 31.4);
-    TGeoCombiTrans* slopeTrRot =
-      new TGeoCombiTrans(name + "_slopepillar_posrot_1", 0., 0., -(x + sqrt(2.) * t - 2. * t) / 2., slopeRot);
-
-    frameBoxVol->AddNode(frameSlopePillarVol, 1, slopeTrRot);
-
-    Double_t angl = 23.;
-    // --- Small sub pillar
-    TGeoPara* frameSubPillarShp =
-      new TGeoPara(name + "_subpillar_shape", (sqrt(2) * (x / 2. - t) - t / 2.) / TMath::Cos(angl / 180. * TMath::Pi()),
-                   gkThinFrameThickness / 2., gkThinFrameThickness / 2., angl, 0., 90.);
-    TGeoVolume* frameSubPillarVol = new TGeoVolume(name + "_subpillar", frameSubPillarShp, framesMaterial);
-    frameSubPillarVol->SetLineColor(kMagenta);
-
-    Double_t posZ = t * (1. - 3. / (2. * sqrt(2.)));
-
-    // one side of X direction
-    TGeoRotation* subRot1 = new TGeoRotation(name + "_subpillar_rot_1", 90., 45., -90. + angl);
-    TGeoCombiTrans* subTrRot1 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_1", -(-x / 2. + t - t / (2. * sqrt(2.))), 1., posZ, subRot1);
-
-    TGeoRotation* subRot2 = new TGeoRotation(name + "_subpillar_rot_2", 90., -90. - 45., -90. + angl);
-    TGeoCombiTrans* subTrRot2 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_2", -(-x / 2. + t - t / (2. * sqrt(2.))), -1., posZ, subRot2);
-
-    // other side of X direction
-    TGeoRotation* subRot3 = new TGeoRotation(name + "_subpillar_rot_3", 90., 90. + 45., -90. + angl);
-    TGeoCombiTrans* subTrRot3 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_3", -x / 2. + t - t / (2. * sqrt(2.)), 1., posZ, subRot3);
-
-    TGeoRotation* subRot4 = new TGeoRotation(name + "_subpillar_rot_4", 90., -45., -90. + angl);
-    TGeoCombiTrans* subTrRot4 =
-      new TGeoCombiTrans(name + "_subpillar_posrot_4", -x / 2. + t - t / (2. * sqrt(2.)), -1., posZ, subRot4);
-
-    frameBoxVol->AddNode(frameSubPillarVol, 1, subTrRot1);
-    frameBoxVol->AddNode(frameSubPillarVol, 2, subTrRot2);
-    frameBoxVol->AddNode(frameSubPillarVol, 3, subTrRot3);
-    frameBoxVol->AddNode(frameSubPillarVol, 4, subTrRot4);
-    //                frameBoxVol->GetShape()->ComputeBBox();
-  }
-
-  return frameBoxVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructSmallCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  //	TGeoBBox* B = new TGeoBBox ("B", 8., 6., 10.);
-
-  Double_t radius    = 3.0;
-  Double_t thickness = 0.04;  // 0.4 mm
-  //	TGeoConeSeg* A = new TGeoConeSeg ("A", coneDz, 3., 3.2, 3., 3.2, 0., 180.);
-  TGeoConeSeg* A = new TGeoConeSeg("A", coneDz, radius, radius + thickness, radius, radius + thickness, 0., 180.);
-  TGeoBBox* B    = new TGeoBBox("B", 8., 6., 10.);
-
-  TGeoCombiTrans* M = new TGeoCombiTrans("M");
-  M->RotateX(45.);
-  M->SetDy(-5.575);
-  M->SetDz(6.935);
-  M->RegisterYourself();
-
-  TGeoShape* coneShp  = new TGeoCompositeShape("Cone_shp", "A-B:M");
-  TGeoVolume* coneVol = new TGeoVolume("Cone", coneShp, framesMaterial);
-  coneVol->SetLineColor(kGreen);
-  //	coneVol->RegisterYourself();
-
-  //	// --- Inner cone
-  //	Double_t thickness = 0.02;
-  //	Double_t thickness2 = 0.022;
-  //	//	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 6.+thickness, 7.6-thickness2, 5.99+thickness, 6.05-thickness2, 0., 180.);
-  //	TGeoConeSeg* A2 = new TGeoConeSeg ("A2", coneDz-thickness, 3.+thickness, 4.6-thickness2, 2.99+thickness, 3.05-thickness2, 0., 180.);
-  //
-  //	TGeoCombiTrans* M2 = new TGeoCombiTrans ("M2");
-  //	M2->RotateX (45.);
-  //	M2->SetDy (-5.575+thickness*sqrt(2.));
-  //	M2->SetDz (6.935);
-  //	M2->RegisterYourself();
-  //
-  //	TGeoShape* coneShp2 = new TGeoCompositeShape ("Cone2_shp", "A2-B:M2");
-  //	TGeoVolume* coneVol2 = new TGeoVolume ("Cone2", coneShp2, gStsMedium);
-  //	coneVol2->SetLineColor(kGreen);
-  ////	coneVol2->RegisterYourself();
-  //
-  //	coneVol->AddNode(coneVol2, 1);
-
-  return coneVol;
-}
-/** ======================================================================= **/
-
-/** ======================================================================= **/
-TGeoVolume* ConstructBigCone(Double_t coneDz)
-{
-  // --- Material of the frames
-  TGeoMedium* framesMaterial = gGeoMan->GetMedium("carbon");
-
-  // --- Outer cone
-  TGeoConeSeg* bA = new TGeoConeSeg("bA", coneDz, 6., 7.6, 6., 6.04, 0., 180.);
-  TGeoBBox* bB    = new TGeoBBox("bB", 8., 6., 10.);
-
-  TGeoCombiTrans* bM = new TGeoCombiTrans("bM");
-  bM->RotateX(45.);
-  bM->SetDy(-5.575);
-  bM->SetDz(6.935);
-  bM->RegisterYourself();
-
-  TGeoShape* coneBigShp  = new TGeoCompositeShape("ConeBig_shp", "bA-bB:bM");
-  TGeoVolume* coneBigVol = new TGeoVolume("ConeBig", coneBigShp, framesMaterial);
-  coneBigVol->SetLineColor(kGreen);
-  //	coneBigVol->RegisterYourself();
-
-  // --- Inner cone
-  Double_t thickness  = 0.02;
-  Double_t thickness2 = 0.022;
-  TGeoConeSeg* bA2    = new TGeoConeSeg("bA2", coneDz - thickness, 6. + thickness, 7.6 - thickness2, 5.99 + thickness,
-                                     6.05 - thickness2, 0., 180.);
-
-  TGeoCombiTrans* bM2 = new TGeoCombiTrans("bM2");
-  bM2->RotateX(45.);
-  bM2->SetDy(-5.575 + thickness * sqrt(2.));
-  bM2->SetDz(6.935);
-  bM2->RegisterYourself();
-
-  TGeoShape* coneBigShp2  = new TGeoCompositeShape("ConeBig2_shp", "bA2-bB:bM2");
-  TGeoVolume* coneBigVol2 = new TGeoVolume("ConeBig2", coneBigShp2, gStsMedium);
-  coneBigVol2->SetLineColor(kGreen);
-  //	coneBigVol2->RegisterYourself();
-
-  coneBigVol->AddNode(coneBigVol2, 1);
-
-  return coneBigVol;
-}
-/** ======================================================================= **/
diff --git a/macro/mcbm/geometry/sts/no_keeping_volume.patch b/macro/mcbm/geometry/sts/no_keeping_volume.patch
deleted file mode 100644
index eaee4f6fa6..0000000000
--- a/macro/mcbm/geometry/sts/no_keeping_volume.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-*** create_stsgeo_v18f.C	2017-11-10 13:50:43.850195673 +0100
---- create_stsgeo_v18f_nokeep.C	2017-11-10 13:36:26.853451483 +0100
-***************
-*** 880,886 ****
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape", 
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-!   TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-  
-    // --- Place stations in the STS
-    //  for (Int_t iStation = 1; iStation <=8; iStation++) {
---- 880,887 ----
-  //  TGeoShape* stsShape = new TGeoCompositeShape("stsShape", 
-  //                                               "stsBox-stsCone1:trans1-stsCone2:trans2");
-  //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsShape, gStsMedium);
-! //  TGeoVolume* sts = new TGeoVolume(stsName.Data(), stsBox, gStsMedium);
-!   TGeoVolumeAssembly* sts = new TGeoVolumeAssembly(stsName.Data());   // do not produce keeping volumes
-  
-    // --- Place stations in the STS
-    //  for (Int_t iStation = 1; iStation <=8; iStation++) {
-***************
-*** 2086,2093 ****
-  //  
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-!   TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-!   
-    Double_t subtractedVal;
-    
-    // --- Place ladders in station
---- 2087,2095 ----
-  //  
-  //  statShape = new TGeoCompositeShape(name, expression.Data());
-  //  TGeoVolume* station = new TGeoVolume(name, statShape, gStsMedium);
-! //  TGeoVolume* station = new TGeoVolume(name, statBox, gStsMedium);
-!   TGeoVolumeAssembly* station = new TGeoVolumeAssembly(name);   // do not produce keeping volumes
-! 
-    Double_t subtractedVal;
-    
-    // --- Place ladders in station
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19b.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19b.C
deleted file mode 100644
index 767a3729a0..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19b.C
+++ /dev/null
@@ -1,535 +0,0 @@
-/* Copyright (C) 2016-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19b.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";  // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19b.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v19b_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v19b";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19b()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19b:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  pipe->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  pipe->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  pipe->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  pipe->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  pipe->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  pipe->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  pipe->AddNode(vpipe10, 1, tra10);
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  pipe->AddNode(vvacu10, 1, tra10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  pipe->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30    = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1, tra30);
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  pipe->AddNode(vvacu30, 1, tra30);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19c.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19c.C
deleted file mode 100644
index d91ee9f9e1..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19c.C
+++ /dev/null
@@ -1,536 +0,0 @@
-/* Copyright (C) 2016-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19c.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19c    - rotate targetbox by 28 degrees instead of 25
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";  // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19c.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v19c_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v19c";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19c()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19c:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 28.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  pipe->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  pipe->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  pipe->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  pipe->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  pipe->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  pipe->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  pipe->AddNode(vpipe10, 1, tra10);
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  pipe->AddNode(vvacu10, 1, tra10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  pipe->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30    = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1, tra30);
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  pipe->AddNode(vvacu30, 1, tra30);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19d.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19d.C
deleted file mode 100644
index b398374fd1..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19d.C
+++ /dev/null
@@ -1,550 +0,0 @@
-/* Copyright (C) 2016-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19d.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19d    - create two separate volumes, one with the targetbox the
- **                other one with the pipe
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";  // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19d.C";
-// ---> Geometry file name (output)
-TString targetBoxFileName = "pipe_v19d_tb_mcbm.geo.root";
-TString pipeFileName      = "pipe_v19d_mcbm.geo.root";
-// ---> Geometry name
-TString targetBoxName = "targetbox_v19d";
-TString pipeName      = "pipe_v19d";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19d()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19d:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = targetBoxFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The targetbox and the pipe after the targetbox are implemented" << endl;
-  infoFile << "into two different TGeoVolumeAssemblies and exported into two" << endl;
-  infoFile << "different output files which both needs to be loaded in the" << endl;
-  infoFile << "simulation. This separation was done due to work around a" << endl;
-  infoFile << "problem with the TGeoManager." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe      = new TGeoVolumeAssembly(pipeName.Data());
-  TGeoVolume* targetbox = new TGeoVolumeAssembly(targetBoxName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  targetbox->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  targetbox->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  targetbox->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  targetbox->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  targetbox->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  targetbox->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  targetbox->AddNode(vpipe10, 1, tra10);
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  targetbox->AddNode(vvacu10, 1, tra10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  targetbox->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30 = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1);
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  pipe->AddNode(vvacu30, 1);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0., 0., +length30 / 2 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(targetbox, 1);
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-
-  targetbox->Export(targetBoxFileName);
-
-  TFile* targetBoxFile = new TFile(targetBoxFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  TGeoCombiTrans* targetbox_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  targetbox_placement->Write();
-
-  targetBoxFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << targetBoxFileName << endl;
-
-  pipe->Export(pipeFileName);
-
-  TFile* pipeFile = new TFile(pipeFileName, "UPDATE");
-
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  Double_t placement_x   = TMath::Cos(pipe_angle * TMath::DegToRad()) * rmax20;
-  Double_t placement_z = TMath::Cos(pipe_angle * TMath::DegToRad()) * (-offset20 + length20 + length22 + length30 / 2.);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", placement_x, 0., placement_z, pipe_rotation);
-  pipe_placement->Write();
-
-  pipeFile->Close();
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19e.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19e.C
deleted file mode 100644
index 1cde2933a4..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19e.C
+++ /dev/null
@@ -1,582 +0,0 @@
-/* Copyright (C) 2016-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19e.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19e    - extend the downstream end of the pipe to the beam dump for 2021
- ** pipe v19d    - create two separate volumes, one with the targetbox the
- **                other one with the pipe
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";  // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19e.C";
-// ---> Geometry file name (output)
-TString targetBoxFileName = "pipe_v19e_tb_mcbm.geo.root";
-TString pipeFileName      = "pipe_v19e_mcbm.geo.root";
-// ---> Geometry name
-TString targetBoxName = "targetbox_v19e";
-TString pipeName      = "pipe_v19e";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19e()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19e:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = targetBoxFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The targetbox and the pipe after the targetbox are implemented" << endl;
-  infoFile << "into two different TGeoVolumeAssemblies and exported into two" << endl;
-  infoFile << "different output files which both needs to be loaded in the" << endl;
-  infoFile << "simulation. This separation was done due to work around a" << endl;
-  infoFile << "problem with the TGeoManager." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe      = new TGeoVolumeAssembly(pipeName.Data());
-  TGeoVolume* targetbox = new TGeoVolumeAssembly(targetBoxName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  targetbox->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  targetbox->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  targetbox->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  targetbox->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  targetbox->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  targetbox->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  targetbox->AddNode(vpipe10, 1, tra10);
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  targetbox->AddNode(vvacu10, 1, tra10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  targetbox->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30 = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1);
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  pipe->AddNode(vvacu30, 1);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // 1st downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0., 0., +length30 / 2 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  // Laenge      300.0 cm
-  // Durchmesser  10.0 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax50   = 10.0 / 2.;
-  Double_t rmin50   = rmax50 - 0.2;
-  Double_t length50 = 300.0;  // 44.0;
-
-  // 2nd downstream flange
-  TGeoVolume* vfla32 =
-    gGeoManager->MakeCtub("flange32", pipeMedium, rmax50, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., +length30 / 2 + length40 / 2.);
-  //  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., +length30/2 +length40/2. + 20.);
-  vfla32->SetLineColor(kRed);
-  pipe->AddNode(vfla32, 1, fla32);
-
-  TGeoVolume* vpipe50 =
-    gGeoManager->MakeCtub("pipe50", pipeMedium, rmin50, rmax50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., +length30 / 2 + length50 / 2.);
-  //  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., +length30/2 +length50/2. + 20.);
-  vpipe50->SetLineColor(kRed);
-  pipe->AddNode(vpipe50, 1, fla50);
-
-  TGeoVolume* vvacu50 =
-    gGeoManager->MakeCtub("vacu50", vacuum, 0, rmin50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu50->SetLineColor(kYellow);
-  pipe->AddNode(vvacu50, 1, fla50);
-
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(targetbox, 1);
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-
-  targetbox->Export(targetBoxFileName);
-
-  TFile* targetBoxFile = new TFile(targetBoxFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  TGeoCombiTrans* targetbox_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  targetbox_placement->Write();
-
-  targetBoxFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << targetBoxFileName << endl;
-
-  pipe->Export(pipeFileName);
-
-  TFile* pipeFile = new TFile(pipeFileName, "UPDATE");
-
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  Double_t placement_x   = TMath::Cos(pipe_angle * TMath::DegToRad()) * rmax20;
-  Double_t placement_z = TMath::Cos(pipe_angle * TMath::DegToRad()) * (-offset20 + length20 + length22 + length30 / 2.);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", placement_x, 0., placement_z, pipe_rotation);
-  pipe_placement->Write();
-
-  pipeFile->Close();
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19f.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19f.C
deleted file mode 100644
index 09b1bdd202..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19f.C
+++ /dev/null
@@ -1,572 +0,0 @@
-/* Copyright (C) 2016-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19f.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19f    - reproduce v19e in a single piece as originally in v19b
- ** pipe v19e    - extend the downstream end of the pipe to the beam dump for 2021
- ** pipe v19d    - create two separate volumes, one with the targetbox the
- **                other one with the pipe
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-const Bool_t IncludeVacuum = true;  // false;  // true, if vacuum to be placed inside the pipe
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";  // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19f.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v19f_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v19f";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19f()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19f:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  pipe->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  if (IncludeVacuum) pipe->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  pipe->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  pipe->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  pipe->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  pipe->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  pipe->AddNode(vpipe10, 1, tra10);
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu10, 1, tra10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  pipe->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30    = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1, tra30);
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu30, 1, tra30);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  // Laenge      300.0 cm
-  // Durchmesser  10.0 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax50   = 10.0 / 2.;
-  Double_t rmin50   = rmax50 - 0.2;
-  Double_t length50 = 300.0;  // 44.0;
-
-  // 2nd downstream flange
-  TGeoVolume* vfla32 =
-    gGeoManager->MakeCtub("flange32", pipeMedium, rmax50, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 + length20 + length30 + length40 / 2.);
-  //  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 +length20 +length30 +length40/2. + 20.);
-  vfla32->SetLineColor(kRed);
-  pipe->AddNode(vfla32, 1, fla32);
-
-  TGeoVolume* vpipe50 =
-    gGeoManager->MakeCtub("pipe50", pipeMedium, rmin50, rmax50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 + length20 + length30 + length50 / 2.);
-  //  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 +length20 +length30 +length50/2. + 20.);
-  vpipe50->SetLineColor(kRed);
-  pipe->AddNode(vpipe50, 1, fla50);
-
-  TGeoVolume* vvacu50 =
-    gGeoManager->MakeCtub("vacu50", vacuum, 0, rmin50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu50->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu50, 1, fla50);
-
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19g.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19g.C
deleted file mode 100644
index a55a5bc832..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19g.C
+++ /dev/null
@@ -1,573 +0,0 @@
-/* Copyright (C) 2016-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19g.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19g    - based on v19f, without vacuum inside
- ** pipe v19f    - reproduce v19e in a single piece as originally in v19b
- ** pipe v19e    - extend the downstream end of the pipe to the beam dump for 2021
- ** pipe v19d    - create two separate volumes, one with the targetbox the
- **                other one with the pipe
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-const Bool_t IncludeVacuum = false;  // true;  // true, if vacuum to be placed inside the pipe
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";  // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19g.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v19g_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v19g";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19g()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19g:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  pipe->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  if (IncludeVacuum) pipe->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  pipe->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  pipe->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  pipe->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  pipe->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  pipe->AddNode(vpipe10, 1, tra10);
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu10, 1, tra10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  pipe->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30    = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1, tra30);
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu30, 1, tra30);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  // Laenge      300.0 cm
-  // Durchmesser  10.0 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax50   = 10.0 / 2.;
-  Double_t rmin50   = rmax50 - 0.2;
-  Double_t length50 = 300.0;  // 44.0;
-
-  // 2nd downstream flange
-  TGeoVolume* vfla32 =
-    gGeoManager->MakeCtub("flange32", pipeMedium, rmax50, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 + length20 + length30 + length40 / 2.);
-  //  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 +length20 +length30 +length40/2. + 20.);
-  vfla32->SetLineColor(kRed);
-  pipe->AddNode(vfla32, 1, fla32);
-
-  TGeoVolume* vpipe50 =
-    gGeoManager->MakeCtub("pipe50", pipeMedium, rmin50, rmax50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 + length20 + length30 + length50 / 2.);
-  //  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 +length20 +length30 +length50/2. + 20.);
-  vpipe50->SetLineColor(kRed);
-  pipe->AddNode(vpipe50, 1, fla50);
-
-  TGeoVolume* vvacu50 =
-    gGeoManager->MakeCtub("vacu50", vacuum, 0, rmin50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu50->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu50, 1, fla50);
-
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19h.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19h.C
deleted file mode 100644
index 22837322d0..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v19h.C
+++ /dev/null
@@ -1,575 +0,0 @@
-/* Copyright (C) 2016-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann, Florian Uhlig [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v19h.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v19h    - based on v19g, removing the downstream plate and window of the targetbox
- ** pipe v19g    - based on v19f, without vacuum inside
- ** pipe v19f    - reproduce v19e in a single piece as originally in v19b
- ** pipe v19e    - extend the downstream end of the pipe to the beam dump for 2021
- ** pipe v19d    - create two separate volumes, one with the targetbox the
- **                other one with the pipe
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-const Bool_t IncludeVacuum          = false;  // true;  // true, if vacuum to be placed inside the pipe
-const Bool_t IncludeDownstreamCover = false;  // true;  // true, if downstream cover with cutout to be placed
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "iron";  // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v19h.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v19h_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v19h";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v19h()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v19h:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  // ---> iron
-  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  geoBuild->createMedium(mIron);
-  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  pipe->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  if (IncludeVacuum) pipe->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  pipe->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  if (IncludeDownstreamCover) pipe->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  pipe->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  pipe->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  pipe->AddNode(vpipe10, 1, tra10);
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu10, 1, tra10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  pipe->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30    = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1, tra30);
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu30, 1, tra30);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  // Laenge      300.0 cm
-  // Durchmesser  10.0 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax50   = 10.0 / 2.;
-  Double_t rmin50   = rmax50 - 0.2;
-  Double_t length50 = 300.0;  // 44.0;
-
-  // 2nd downstream flange
-  TGeoVolume* vfla32 =
-    gGeoManager->MakeCtub("flange32", pipeMedium, rmax50, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 + length20 + length30 + length40 / 2.);
-  //  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 +length20 +length30 +length40/2. + 20.);
-  vfla32->SetLineColor(kRed);
-  pipe->AddNode(vfla32, 1, fla32);
-
-  TGeoVolume* vpipe50 =
-    gGeoManager->MakeCtub("pipe50", pipeMedium, rmin50, rmax50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 + length20 + length30 + length50 / 2.);
-  //  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 +length20 +length30 +length50/2. + 20.);
-  vpipe50->SetLineColor(kRed);
-  pipe->AddNode(vpipe50, 1, fla50);
-
-  TGeoVolume* vvacu50 =
-    gGeoManager->MakeCtub("vacu50", vacuum, 0, rmin50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu50->SetLineColor(kYellow);
-  if (IncludeVacuum) pipe->AddNode(vvacu50, 1, fla50);
-
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v20a.C b/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v20a.C
deleted file mode 100644
index d3c326a105..0000000000
--- a/macro/mcbm/geometry/targetbox/create_bpipe_geometry_v20a.C
+++ /dev/null
@@ -1,654 +0,0 @@
-/* Copyright (C) 2016-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-/******************************************************************************
- ** Creation of beam pipe geometry in ROOT format (TGeo).
- **
- ** @file create_bpipe_geometry_v20a.C
- ** @author David Emschermann <d.emschermann@gsi.de>
- ** @author Andrey Chernogorov <a.chernogorov@gsi.de>
- ** @date 19.07.2016
- **
- ** mCBM
- ** pipe v20a    - based on v19f, adding 3 iron foils at the start and end of the vacuum
-                   replica of the setup in spring 2020
- ** pipe v19h    - based on v19g, removing the downstream plate and window of the targetbox
- ** pipe v19g    - based on v19f, without vacuum inside
- ** pipe v19f    - reproduce v19e in a single piece as originally in v19b
- ** pipe v19e    - extend the downstream end of the pipe to the beam dump for 2021
- ** pipe v19d    - create two separate volumes, one with the targetbox the
- **                other one with the pipe
- ** pipe v19b    - build target box from CAD design
- ** pipe v19a    - adapt dimensions of beampipe to technical drawings
- ** pipe v18g    - rotate 2-diameter beampipe v18f to 25 degrees
- ** pipe v18f    - increase pipe length from 3.00 m to 4.00 m
- ** pipe v18f    - reduce diameter of first 50 cm of beampipe to avoid collision with mSTS
- ** pipe v18e    - rotate cylindrical pipe around the vertical (y) axis by 20 degrees
- ** pipe v18d    - rotate cylindrical pipe around the vertical (y) axis by 25 degrees
- **
- ** SIS-100
- ** pipe v16c_1e - is a pipe for the STS up to the interface to RICH at z = 1700 mm
- **                with a (blue) flange at the downstream end of the STS box
- **
- ** The beam pipe is composed of carbon with a fixed wall thickness of 0.5 or 1.0 mm.
- ** It is placed directly into the cave as mother volume. The beam pipe consists of 
- ** few sections up to the RICH section (1700-3700mm), which is part of the RICH geometry. 
- ** Each section has a PCON shape (including windows).
- ** The STS section is composed of cylinder D(z=220-410mm)=34mm and cone (z=410-1183mm). 
- ** All sections of the beam pipe with conical shape have half opening angle 2.5deg.
- *****************************************************************************/
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-// naming scheme
-// main elements - flanges
-// pipe10 - pipe11
-// pipe20 - pipe21, 22, 23, 24, 25
-// pipe30 - pipe31
-
-
-#include "TGeoManager.h"
-#include "TGeoPcon.h"
-#include "TGeoTube.h"
-
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-const Bool_t IncludeVacuum          = true;   // false;  // true, if vacuum to be placed inside the pipe
-const Bool_t IncludeDownstreamCover = true;   // false;  // true, if downstream cover with cutout to be placed
-const Bool_t IncludeDownstreamPipe  = false;  // true;  // true, if pipe towards the beamdump to be added
-const Bool_t IncludeFoils           = true;   // false;  // true, if foils to be placed in the vacuum pipe
-
-Double_t foilthickness = 0.01;  // cm = 0.1 mm
-
-// -------------   Steering variables       -----------------------------------
-// ---> Beam pipe material name
-TString pipeMediumName = "pipeiron";  // "iron"; // "carbon"; // "beryllium"; // "aluminium";
-// ----------------------------------------------------------------------------
-
-
-// -------------   Other global variables   -----------------------------------
-// ---> Macro name to info file
-TString macroname = "create_bpipe_geometry_v20a.C";
-// ---> Geometry file name (output)
-TString rootFileName = "pipe_v20a_mcbm.geo.root";
-// ---> Geometry name
-TString pipeName = "pipe_v20a";
-// ----------------------------------------------------------------------------
-
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3);
-
-//TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                     Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-//
-//TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-//                       Double_t* rout, TGeoMedium* medium, fstream* infoFile);
-
-// ============================================================================
-// ======                         Main function                           =====
-// ============================================================================
-
-void create_bpipe_geometry_v20a()
-{
-  // -----   Define beam pipe sections   --------------------------------------
-  /** For v20a:   **/
-  TString pipe1name = "pipe1 - straight miniCBM beampipe";
-
-  // start and stop angles of beampipe
-
-  //  Double_t angle1 = 180;  // lower half
-  //  Double_t angle2 =   0;  // lower half
-  //
-  //  Double_t angle1 = 190;  // open cut @ -x
-  //  Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // closed
-  Double_t angle2 = 360;  // closed
-
-  Double_t nlow[3];
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  Double_t theta = 25. * TMath::Pi() / 180.;
-  Double_t phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  Double_t pipe_angle = 25.;  // rotation angle around y-axis
-
-  // tan (acos(-1)/180 * 2.5) *  30 cm = 1.310 cm
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-  cout << "2 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // end of thin beampipe in reality: 610 mm downstream of target
-
-  // --------------------------------------------------------------------------
-
-
-  // -------   Open info file   -----------------------------------------------
-  TString infoFileName = rootFileName;
-  infoFileName.ReplaceAll("root", "info");
-  fstream infoFile;
-  fstream infoFileEmpty;
-  infoFile.open(infoFileName.Data(), fstream::out);
-  infoFile << "SIS-18 mCBM beam pipe geometry created with " + macroname << endl;
-  infoFile << "Introducing the target chamber derived from CAD drawings." << endl << endl;
-  //  infoFile << "It ends at z=610 mm downstream of the target." << endl << endl;
-  infoFile << "The beam pipe is composed of iron with a varying wall thickness." << endl << endl;
-  infoFile << "Material:  " << pipeMediumName << endl;
-  // --------------------------------------------------------------------------
-
-
-  // -------   Load media from media file   -----------------------------------
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-  TGeoManager* gGeoMan = gGeoManager;
-  // --------------------------------------------------------------------------
-
-
-  // -----------------   Get and create the required media    -----------------
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  // ---> pipe medium
-  FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
-  TString fairError          = "FairMedium " + pipeMediumName + " not found";
-  if (!fPipeMedium) Fatal("Main", "%s", fairError.Data());
-  geoBuild->createMedium(fPipeMedium);
-  TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
-  TString geoError       = "Medium " + pipeMediumName + " not found";
-  if (!pipeMedium) Fatal("Main", "%s", geoError.Data());
-
-  //  // ---> iron
-  //  FairGeoMedium* mIron = geoMedia->getMedium("iron");
-  //  if (!mIron) Fatal("Main", "FairMedium iron not found");
-  //  geoBuild->createMedium(mIron);
-  //  TGeoMedium* iron = gGeoMan->GetMedium("iron");
-  //  if (!iron) Fatal("Main", "Medium iron not found");
-
-  //  // ---> lead
-  //  FairGeoMedium* mLead = geoMedia->getMedium("lead");
-  //  if ( ! mLead ) Fatal("Main", "FairMedium lead not found");
-  //  geoBuild->createMedium(mLead);
-  //  TGeoMedium* lead = gGeoMan->GetMedium("lead");
-  //  if ( ! lead ) Fatal("Main", "Medium lead not found");
-
-  //  // ---> carbon
-  //  FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
-  //  if ( ! mCarbon ) Fatal("Main", "FairMedium carbon not found");
-  //  geoBuild->createMedium(mCarbon);
-  //  TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
-  //  if ( ! carbon ) Fatal("Main", "Medium carbon not found");
-
-  // ---> vacuum
-  FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
-  if (!mVacuum) Fatal("Main", "FairMedium vacuum not found");
-  geoBuild->createMedium(mVacuum);
-  TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
-  if (!vacuum) Fatal("Main", "Medium vacuum not found");
-  // --------------------------------------------------------------------------
-
-
-  // --------------   Create geometry and top volume  -------------------------
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetName("PIPEgeom");
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-  TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
-  // --------------------------------------------------------------------------
-
-
-  // -----   Create sections  -------------------------------------------------
-  Int_t i = 0;
-
-  // Aussendurchmesser 35.56 cm
-  // Wanddicke           0.3 cm
-  // Laenge             45.1 cm
-  // Offset             29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20    = gGeoManager->MakeCtub("pipe20", pipeMedium, rmin20, rmax20, length20 / 2., angle1, angle2,
-                                              nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  vpipe20->SetLineColor(kBlue);
-  pipe->AddNode(vpipe20, 1, tra20);
-
-  TGeoVolume* vvacu20 = gGeoManager->MakeCtub("vacu20", vacuum, 0, rmin20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vvacu20->SetLineColor(kYellow);
-  vvacu20->SetTransparency(50);
-  if (IncludeVacuum) pipe->AddNode(vvacu20, 1, tra20);
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", pipeMedium, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  vwall21->SetLineColor(kBlue);
-  pipe->AddNode(vwall21, 1, tra21);
-
-  //=======================================================================================
-
-  // downstream cover with cutout
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);  // compensate for 25 degree rotation
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);  // 0.0001 avoids optical error
-  tfra1->RegisterYourself();
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate clockwise
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate counter clockwise
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-  //  TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut",
-  //                          cos(25.*acos(-1.)/180.) * -10.0, 0., sin(25.*acos(-1.)/180.) * -10.0, rot22);
-  //  tcut->RegisterYourself();
-
-  // cutout inner border at:
-  //  x : cos(25.*acos(-1.)/180.) *  -4.25              : x =  -3.852 cm
-  //  z : sin(25.*acos(-1.)/180.) *  -4.25 + 15.2 + 0.3 : z =  13.704 cm
-
-  // cutout outer border at:
-  //  x : cos(25.*acos(-1.)/180.) * -15.75              : x = -14.274 cm
-  //  z : sin(25.*acos(-1.)/180.) * -15.75 + 15.2 + 0.3 : z =   8.843 cm
-
-  //  TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //  TGeoVolume *vpipe22 = new TGeoVolume("wall22", compsha, pipeMedium);
-  //  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 +length20 +length22/2.);
-
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-  TGeoVolume* vpipe22         = new TGeoVolume("wall22", compsha, pipeMedium);
-  TGeoCombiTrans* tra22       = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  vpipe22->SetLineColor(kBlue);
-  if (IncludeDownstreamCover) pipe->AddNode(vpipe22, 1, tra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23    = gGeoManager->MakeTube("shaft23", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  tube23->SetLineColor(kBlue);
-  pipe->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24    = gGeoManager->MakeTube("shaft24", pipeMedium, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  tube24->SetLineColor(kBlue);
-  pipe->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", pipeMedium, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  vpipe10->SetLineColor(kBlue);
-  pipe->AddNode(vpipe10, 1, tra10);
-
-  Double_t lenfoil10 = 0;
-  if (IncludeFoils) {
-    lenfoil10 = foilthickness;
-    TGeoVolume* vfoil10 =
-      gGeoManager->MakeCtub("foil10", pipeMedium, 0, rmin10, lenfoil10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-    TGeoTranslation* trafoil10 = new TGeoTranslation("trafoil10", 0, 0, -offset20 - length10 + lenfoil10 / 2.);
-    vfoil10->SetLineColor(kRed);
-    pipe->AddNode(vfoil10, 1, trafoil10);
-  }
-
-  TGeoVolume* vvacu10 =
-    gGeoManager->MakeCtub("vacu10", vacuum, 0, rmin10, (length10 - lenfoil10) / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu10->SetLineColor(kYellow);
-  TGeoTranslation* travacu10 = new TGeoTranslation("travacu10", 0, 0, -offset20 - (length10 - lenfoil10) / 2.);
-  if (IncludeVacuum) pipe->AddNode(vvacu10, 1, travacu10);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", pipeMedium, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  vfla11->SetLineColor(kBlue);
-  pipe->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // accelerator pipe flange
-  Double_t gap0010 = 12.5;  // gap bewtween foils in acc pipe and targetbox
-
-  Double_t rmax00   = 15.9 / 2.;
-  Double_t rmin00   = rmax00 - 0.2;
-  Double_t length00 = 9.5;  // arbitrary length
-
-  TGeoVolume* vpipe00 =
-    gGeoManager->MakeCtub("pipe00", pipeMedium, rmin00, rmax00, length00 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra00 = new TGeoTranslation("tra00", 0, 0, -offset20 - length10 - gap0010 - length00 / 2.);
-  vpipe00->SetLineColor(kBlue);
-  pipe->AddNode(vpipe00, 1, tra00);
-
-  Double_t lenfoil00 = 0;
-  if (IncludeFoils) {
-    lenfoil00 = foilthickness;
-    TGeoVolume* vfoil00 =
-      gGeoManager->MakeCtub("foil00", pipeMedium, 0, rmin00, lenfoil00 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-    TGeoTranslation* trafoil00 =
-      new TGeoTranslation("trafoil00", 0, 0, -offset20 - length10 - gap0010 - lenfoil00 / 2.);
-    vfoil00->SetLineColor(kRed);
-    pipe->AddNode(vfoil00, 1, trafoil00);
-  }
-
-  TGeoVolume* vvacu00 =
-    gGeoManager->MakeCtub("vacu00", vacuum, 0, rmin00, (length00 - lenfoil00) / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu00->SetLineColor(kYellow);
-  TGeoTranslation* travacu00 =
-    new TGeoTranslation("travacu00", 0, 0, -offset20 - length10 - gap0010 - lenfoil00 - (length00 - lenfoil00) / 2.);
-  if (IncludeVacuum) pipe->AddNode(vvacu00, 1, travacu00);
-
-  // upstream flange
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax01   = 19.9 / 2.;
-  Double_t rmin01   = rmax00;
-  Double_t length01 = 1.8;
-
-  TGeoVolume* vfla01 =
-    gGeoManager->MakeCtub("flange01", pipeMedium, rmin01, rmax01, length01 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* tra01 = new TGeoTranslation("tra01", 0, 0, -offset20 - length10 - gap0010 - length01 / 2.);
-  vfla01->SetLineColor(kBlue);
-  pipe->AddNode(vfla01, 1, tra01);
-
-  //=======================================================================================
-
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30    = gGeoManager->MakeCtub("pipe30", pipeMedium, rmin30, rmax30, length30 / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  vpipe30->SetLineColor(kBlue);
-  pipe->AddNode(vpipe30, 1, tra30);
-
-  Double_t lenfoil30 = 0;
-  if (IncludeFoils) {
-    lenfoil30 = foilthickness;
-    TGeoVolume* vfoil30 =
-      gGeoManager->MakeCtub("foil30", pipeMedium, 0, rmin30, lenfoil30 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-    TGeoTranslation* trafoil30 =
-      new TGeoTranslation("trafoil30", 0, 0, -offset20 + length20 + length30 - lenfoil30 / 2.);
-    vfoil30->SetLineColor(kRed);
-    pipe->AddNode(vfoil30, 1, trafoil30);
-  }
-
-  TGeoVolume* vvacu30 = gGeoManager->MakeCtub("vacu30", vacuum, 0, rmin30, (length30 - lenfoil30) / 2., angle1, angle2,
-                                              -nhi[0], -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vvacu30->SetLineColor(kYellow);
-  TGeoTranslation* travacu30 =
-    new TGeoTranslation("travacu30", 0, 0, -offset20 + length20 + (length30 - lenfoil30) / 2.);
-  if (IncludeVacuum) pipe->AddNode(vvacu30, 1, travacu30);
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", pipeMedium, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  vfla31->SetLineColor(kBlue);
-  pipe->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  // Laenge      300.0 cm
-  // Durchmesser  10.0 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax50   = 10.0 / 2.;
-  Double_t rmin50   = rmax50 - 0.2;
-  Double_t length50 = 300.0;  // 44.0;
-
-  // 2nd downstream flange
-  TGeoVolume* vfla32 =
-    gGeoManager->MakeCtub("flange32", pipeMedium, rmax50, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 + length20 + length30 + length40 / 2.);
-  //  TGeoTranslation* fla32 = new TGeoTranslation("fla32", 0., 0., -offset20 +length20 +length30 +length40/2. + 20.);
-  vfla32->SetLineColor(kRed);
-  if (IncludeDownstreamPipe) pipe->AddNode(vfla32, 1, fla32);
-
-  TGeoVolume* vpipe50 =
-    gGeoManager->MakeCtub("pipe50", pipeMedium, rmin50, rmax50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 + length20 + length30 + length50 / 2.);
-  //  TGeoTranslation* fla50 = new TGeoTranslation("fla50", 0., 0., -offset20 +length20 +length30 +length50/2. + 20.);
-  vpipe50->SetLineColor(kRed);
-  if (IncludeDownstreamPipe) pipe->AddNode(vpipe50, 1, fla50);
-
-  TGeoVolume* vvacu50 =
-    gGeoManager->MakeCtub("vacu50", vacuum, 0, rmin50, length50 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vvacu50->SetLineColor(kYellow);
-  if (IncludeDownstreamPipe)
-    if (IncludeVacuum) pipe->AddNode(vvacu50, 1, fla50);
-
-
-  //=======================================================================================
-
-  //  infoFile << endl << "Beam pipe section: " << pipe1name << endl;
-  //  infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
-  //  TGeoVolume* pipe1    = MakePipe  (1, nSects1,  z1,  rin1,  rout1,  pipeMedium, &infoFile);
-  //  pipe1->SetLineColor(kYellow);
-  //  //  pipe1->SetLineColor(kGray);
-  //  pipe->AddNode(pipe1, 0);
-  //
-  //  TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum,     &infoFile);
-  //  pipevac1->SetLineColor(kCyan);
-  //  pipe->AddNode(pipevac1, 0);
-
-  // -----   End   --------------------------------------------------
-
-  // ---------------   Finish   -----------------------------------------------
-  top->AddNode(pipe, 1);
-  cout << endl << endl;
-  gGeoMan->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoMan->CheckOverlaps(0.0001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  pipe->Export(rootFileName);
-
-  //  TFile* rootFile = new TFile(rootFileName, "RECREATE");
-  //  top->Write();
-
-  TFile* rootFile = new TFile(rootFileName, "UPDATE");
-
-  // rotate the PIPE around y
-  TGeoRotation* pipe_rotation = new TGeoRotation();
-  pipe_rotation->RotateY(pipe_angle);
-  //  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans( sin( pipe_angle/180.*acos(-1) ) * z1[1]/2., 0., 0., pipe_rotation);
-  TGeoCombiTrans* pipe_placement = new TGeoCombiTrans("pipe_rot", 0., 0., 0, pipe_rotation);
-  pipe_placement->Write();
-
-  rootFile->Close();
-
-  cout << endl;
-  cout << "Geometry " << top->GetName() << " written to " << rootFileName << endl;
-
-  infoFile.close();
-
-  // visualize it with ray tracing, OGL/X3D viewer
-  //top->Raytrace();
-  top->Draw("ogl");
-  //top->Draw("x3d");
-}
-// ============================================================================
-// ======                   End of main function                          =====
-// ============================================================================
-
-
-//// =====  Make the beam pipe volume   =========================================
-//TGeoPcon* MakeShape(Int_t nSects, char* name, Double_t* z, Double_t* rin,
-//                    Double_t* rout, fstream* infoFile) {
-//
-//  // ---> Shape
-//  TGeoPcon* shape = new TGeoPcon(name, 0., 360., nSects);
-//  for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//    shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//    *infoFile << setw(2)  << iSect+1
-//              << setw(10) << fixed << setprecision(2) << z[iSect]
-//              << setw(10) << fixed << setprecision(2) << rin[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]
-//              << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//  }
-//
-//  return shape;
-//
-//}
-// ============================================================================
-
-
-// =====  Make the beam pipe volume   =========================================
-TGeoVolume* MakeCutPipe(Int_t ipart, TGeoMedium* medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t angle1,
-                        Double_t angle2, Double_t nlo1, Double_t nlo2, Double_t nlo3, Double_t nhi1, Double_t nhi2,
-                        Double_t nhi3)
-{
-
-  // ---> Shape
-  TString volName = Form("part%i", ipart);
-  TGeoCtub* shape = new TGeoCtub(volName.Data(), rmin, rmax, dz, angle1, angle2, nlo1, nlo2, nlo3, nhi1, nhi2, nhi3);
-
-  // ---> Volume
-  TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-
-  return pipe;
-}
-// ============================================================================
-
-
-// // =====  Make the beam pipe volume   =========================================
-// TGeoVolume* MakePipe(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                 Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipe%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//     *infoFile << setw(2)  << iSect+1
-//               << setw(10) << fixed << setprecision(2) << z[iSect]
-//               << setw(10) << fixed << setprecision(2) << rin[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]
-//               << setw(10) << fixed << setprecision(2) << rout[iSect]-rin[iSect] << endl;
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipe = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipe;
-//
-// }
-// // ============================================================================
-//
-//
-//
-// // =====   Make the volume for the vacuum inside the beam pipe   ==============
-// TGeoVolume* MakeVacuum(Int_t iPart, Int_t nSects, Double_t* z, Double_t* rin,
-// 	                   Double_t* rout, TGeoMedium* medium, fstream* infoFile) {
-//
-//   // ---> Shape
-//   TString volName = Form("pipevac%i", iPart);
-//   TGeoPcon* shape = new TGeoPcon(volName.Data(), 0., 360., nSects);
-//   for (Int_t iSect = 0; iSect < nSects; iSect++) {
-//     shape->DefineSection(iSect, z[iSect]/10., rin[iSect]/10., rout[iSect]/10.); // mm->cm
-//   }
-//
-//   // ---> Volume
-//   TGeoVolume* pipevac = new TGeoVolume(volName.Data(), shape, medium);
-//
-//   return pipevac;
-//
-// }
-// // ============================================================================
diff --git a/macro/mcbm/geometry/targetbox/ctub_orig.C b/macro/mcbm/geometry/targetbox/ctub_orig.C
deleted file mode 100644
index 854d655c45..0000000000
--- a/macro/mcbm/geometry/targetbox/ctub_orig.C
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-// from the following website
-// https://root.cern.ch/doc/master/classTGeoCtub.html
-
-void ctub_orig()
-{
-  TCanvas* c = new TCanvas("c", "c", 0, 0, 600, 600);
-  new TGeoManager("ctub", "poza3");
-  TGeoMaterial* mat = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* med   = new TGeoMedium("MED", 1, mat);
-  TGeoVolume* top   = gGeoManager->MakeBox("TOP", med, 100, 100, 100);
-  gGeoManager->SetTopVolume(top);
-  Double_t theta = 160. * TMath::Pi() / 180.;
-  Double_t phi   = 30. * TMath::Pi() / 180.;
-  Double_t nlow[3];
-  nlow[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nlow[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nlow[2] = TMath::Cos(theta);
-  theta   = 20. * TMath::Pi() / 180.;
-  phi     = 60. * TMath::Pi() / 180.;
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-  TGeoVolume* vol =
-    gGeoManager->MakeCtub("CTUB", med, 20, 30, 40, -30, 250, nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vol->SetLineWidth(2);
-  top->AddNode(vol, 1);
-  gGeoManager->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  top->Draw();
-  TView* view = gPad->GetView();
-  view->ShowAxis();
-}
diff --git a/macro/mcbm/geometry/targetbox/cutout1.C b/macro/mcbm/geometry/targetbox/cutout1.C
deleted file mode 100644
index 120374ddcd..0000000000
--- a/macro/mcbm/geometry/targetbox/cutout1.C
+++ /dev/null
@@ -1,206 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-// from the following website
-// https://root.cern.ch/doc/master/classTGeoCtub.html
-
-void cutout1()
-{
-  TCanvas* c = new TCanvas("c", "c", 0, 0, 600, 600);
-  new TGeoManager("ctub", "poza3");
-  TGeoMaterial* mat = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* med   = new TGeoMedium("MED", 1, mat);
-  TGeoVolume* top   = gGeoManager->MakeBox("TOP", med, 100, 100, 100);
-  gGeoManager->SetTopVolume(top);
-
-  Double_t angle1 = 190;
-  Double_t angle2 = 170;
-
-  //   Double_t angle1 =   0;
-  //   Double_t angle2 = 360;
-
-  Double_t theta = 160. * TMath::Pi() / 180.;
-  Double_t phi   = 30. * TMath::Pi() / 180.;
-
-  Double_t nlow[3];
-  nlow[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nlow[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nlow[2] = TMath::Cos(theta);
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  cout << "2 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-  //
-
-  //   theta = 20.*TMath::Pi()/180.;
-  //   phi   = 60.*TMath::Pi()/180.;
-  theta = 25. * TMath::Pi() / 180.;
-  phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  cout << "3 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // TGeoVolume *ctub = gGeoManager->MakeCtub("CTUB", med, 25, 27, 30, 200, 160, nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-
-  //   // Durchmesser   35.56 cm
-  //   // Wanddicke      0.3 cm
-  //
-  //   // 0.4 + 53.31 + cos(25.*acos(-1.)/180.) * 0.6 = 54.25 cm
-  //
-  //   53.31 cm - tan(25.*acos(-1.)/180.) * 17.78 cm = 45.019050 cm
-
-  //   // check
-  //   60.98 - 45.2 - cos(25.*acos(-1.)/180.) * 0.6 = 15.236215
-  //   60.98 cm - 45.2 cm - cos(25.*acos(-1.)/180.) * 0.6 cm = 15.24 cm
-  //
-  //   15.24 + 38.0 - 7.7 - 0.4 = 45.14
-  //   15.24 cm + 38.0 cm - 7.7 cm - 0.4 cm = 45.14 cm
-  //
-  //   // Laenge       45.1 cm
-  //
-  //   // offset to left side
-  //   38.0 - 7.7 - 0.4 = 29.9
-  //
-  //   // Offset       29.9 cm
-
-  Double_t rmax   = 35.56 / 2.;
-  Double_t rmin   = rmax - 0.3;
-  Double_t length = 45.1;
-  Double_t offset = 29.9;
-
-  TGeoVolume* ctub = gGeoManager->MakeCtub("CTUB", med, rmin, rmax, length / 2., angle1, angle2, nlow[0], nlow[1],
-                                           nlow[2], nhi[0], nhi[1], nhi[2]);
-  ctub->SetLineWidth(2);
-  TGeoTranslation* tctub = new TGeoTranslation("tctub", 0, 0, -offset + length / 2.);
-  top->AddNode(ctub, 1, tctub);
-
-
-  //   from z= -29.9 to z= 15.2 cm
-
-  Double_t rmin1  = 15.9 / 2.;
-  Double_t thick1 = 0.4;
-
-  // upstream cover
-  TGeoVolume* cups = gGeoManager->MakeCtub("CUPS", med, rmin1, rmax, thick1 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  cups->SetLineWidth(2);
-  TGeoTranslation* tups = new TGeoTranslation("tups", 0, 0, -offset - thick1 / 2.);
-  top->AddNode(cups, 1, tups);
-
-
-  // Hoehe                   35.56 cm
-  // Breite   19.62 cm * 2 = 39.24 cm
-  // Dicke                    0.60 mm
-
-  Double_t rmin2  = 5.0 / 2.;
-  Double_t thick2 = 0.6;
-
-  // downstream cover 1
-  TGeoVolume* dwst = gGeoManager->MakeEltu("DWST", med, 39.24 / 2., 35.56 / 2., thick2 / 2.);
-  dwst->SetLineWidth(2);
-  //   TGeoRotation* dwrot = new TGeoRotation();
-  //   dwrot->RotateY(-25.);
-  //   TGeoCombiTrans* tdwst = new TGeoCombiTrans("tdwst", 0, 0, -offset +length +thick2/2., dwrot);
-  TGeoTranslation* tdwst = new TGeoTranslation("tdwst", 0, 0, -offset + length + thick2 / 2.);
-  //   top->AddNode(dwst, 1, tdwst);
-
-
-  //   TGeoVolume *cir1 = gGeoManager->MakeCtub("CIR1", med, 0, 1, 1/2., 0, 360,
-  //					    0, 0,-1, 0, 0, 1);
-  //   cir1->SetLineWidth(2);
-  //   TGeoTranslation* tcir1 = new TGeoTranslation("tcir1", -(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir2 = new TGeoTranslation("tcir2", -(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir3 = new TGeoTranslation("tcir3", +(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir4 = new TGeoTranslation("tcir4", +(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   top->AddNode(cir1, 1, tcir1);
-  //   top->AddNode(cir1, 2, tcir2);
-  //   top->AddNode(cir1, 3, tcir3);
-  //   top->AddNode(cir1, 4, tcir4);
-  //
-  //   TGeoVolume *box1 = gGeoManager->MakeBox("BOX1", med, 11.5/2., 10.0/2.-1., 1/2.);
-  //   box1->SetLineWidth(2);
-  //   TGeoTranslation* tbox1 = new TGeoTranslation("tbox1", 0., 0., 20.);
-  //   top->AddNode(box1, 1, tbox1);
-  //
-  //   TGeoVolume *box2 = gGeoManager->MakeBox("BOX2", med, 11.5/2.-1., 10.0/2., 1/2.);
-  //   box2->SetLineWidth(2);
-  //   TGeoTranslation* tbox2 = new TGeoTranslation("tbox2", 0., 0., 20.);
-  //   top->AddNode(box2, 1, tbox2);
-
-  //   TGeoTranslation* tb1 = new TGeoTranslation("tb1", 0., 0., 0.);
-  //   tb1->RegisterYourself();
-  //   TGeoTranslation* tb2 = new TGeoTranslation("tb2", 0., 0., 0.);
-  //   tb2->RegisterYourself();
-
-  TGeoEltu* dcov = new TGeoEltu(39.24 / 2., 35.56 / 2., thick2 / 2.);
-  dcov->SetName("O");  // shapes need names too
-
-  TGeoBBox* b1 = new TGeoBBox(11.5 / 2., 10.0 / 2. - 1., 1 / 2.);
-  TGeoBBox* b2 = new TGeoBBox(11.5 / 2. - 1., 10.0 / 2., 1 / 2.);
-  b1->SetName("A");  // shapes need names too
-  b2->SetName("B");  // shapes need names too
-
-  TGeoTranslation* tc1 = new TGeoTranslation("tc1", -(11.5 / 2. - 1.), +(10.0 / 2. - 1.), 0.);
-  tc1->RegisterYourself();
-  TGeoTranslation* tc2 = new TGeoTranslation("tc2", -(11.5 / 2. - 1.), -(10.0 / 2. - 1.), 0.);
-  tc2->RegisterYourself();
-  TGeoTranslation* tc3 = new TGeoTranslation("tc3", +(11.5 / 2. - 1.), +(10.0 / 2. - 1.), 0.);
-  tc3->RegisterYourself();
-  TGeoTranslation* tc4 = new TGeoTranslation("tc4", +(11.5 / 2. - 1.), -(10.0 / 2. - 1.), 0.);
-  tc4->RegisterYourself();
-
-  TGeoTranslation* tc5 = new TGeoTranslation("tc5", -10.0, 0., 0.);
-  tc5->RegisterYourself();
-
-  //   TGeoCtub *c1 = new TGeoCtub(0, 1, 1/2., 0, 360, 0, 0,-1, 0, 0, 1);
-  TGeoTube* c1 = new TGeoTube(0.0, 1.0, 0.5);
-  c1->SetName("C");  // shapes need names too
-
-  TGeoCompositeShape* cosha = new TGeoCompositeShape("cosha", " O - ((A + B + C:tc1 + C:tc2 + C:tc3 + C:tc4):tc5) ");
-
-  TGeoVolume* cutout = new TGeoVolume("cutout", cosha, med);
-  cutout->SetLineColor(kBlue);
-
-  TGeoRotation* dwrot = new TGeoRotation();
-  dwrot->RotateY(-25.);
-  TGeoCombiTrans* tcut = new TGeoCombiTrans("tcut", 0, 0, -offset + length + thick2 / 2., dwrot);
-  //   TGeoTranslation* tcut = new TGeoTranslation("tcut", 0, 0, -offset +length +thick2/2.);
-  top->AddNode(cutout, 1, tcut);
-
-  /*
-   // tan(25 deg) * 5.4 cm = 2.518 cm
-   // tan(25.*acos(-1.)/180.) * 5.4 = 2.5180614
-   // 47.12 - tan(25.*acos(-1.)/180.)*5.4 - 0.6 = 44.0 cm 
-   // Laenge       44.0 cm
-   // Durchmesser   5.4 cm
-   // Wanddicke     0.2 cm
-
-   Double_t rmax3   =  5.4 /2.;
-   Double_t rmin3   =  rmax3-0.2;
-   Double_t length3 = 44.0;
-
-   // downstream pipe 
-   TGeoVolume *cpip = gGeoManager->MakeCtub("CPIP", med, rmin2, rmax3, length3/2., angle1, angle2,
-					    -nhi[0],-nhi[1],-nhi[2],-nlow[0],-nlow[1],-nlow[2]);
-   cpip->SetLineWidth(2);
-   TGeoTranslation* tpip = new TGeoTranslation("tpip", 0, 0, -offset +length +thick2 +length3/2.);
-   top->AddNode(cpip, 1, tpip);
-*/
-
-  gGeoManager->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoManager->CheckOverlaps(0.001);
-
-  top->Draw();
-  TView* view = gPad->GetView();
-  view->ShowAxis();
-}
diff --git a/macro/mcbm/geometry/targetbox/cutout2.C b/macro/mcbm/geometry/targetbox/cutout2.C
deleted file mode 100644
index e073446ec5..0000000000
--- a/macro/mcbm/geometry/targetbox/cutout2.C
+++ /dev/null
@@ -1,208 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-// from the following website
-// https://root.cern.ch/doc/master/classTGeoCtub.html
-
-void cutout2()
-{
-  TCanvas* c = new TCanvas("c", "c", 0, 0, 600, 600);
-  new TGeoManager("ctub", "poza3");
-  TGeoMaterial* mat = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* med   = new TGeoMedium("MED", 1, mat);
-  TGeoVolume* top   = gGeoManager->MakeBox("TOP", med, 100, 100, 100);
-  gGeoManager->SetTopVolume(top);
-
-  Double_t angle1 = 190;
-  Double_t angle2 = 170;
-
-  //   Double_t angle1 =   0;
-  //   Double_t angle2 = 360;
-
-  Double_t theta = 160. * TMath::Pi() / 180.;
-  Double_t phi   = 30. * TMath::Pi() / 180.;
-
-  Double_t nlow[3];
-  nlow[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nlow[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nlow[2] = TMath::Cos(theta);
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  cout << "2 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-  //
-
-  //   theta = 20.*TMath::Pi()/180.;
-  //   phi   = 60.*TMath::Pi()/180.;
-  theta = 25. * TMath::Pi() / 180.;
-  phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  cout << "3 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // TGeoVolume *ctub = gGeoManager->MakeCtub("CTUB", med, 25, 27, 30, 200, 160, nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-
-  //   // Durchmesser   35.56 cm
-  //   // Wanddicke      0.3 cm
-  //
-  //   // 0.4 + 53.31 + cos(25.*acos(-1.)/180.) * 0.6 = 54.25 cm
-  //
-  //   53.31 cm - tan(25.*acos(-1.)/180.) * 17.78 cm = 45.019050 cm
-
-  //   // check
-  //   60.98 - 45.2 - cos(25.*acos(-1.)/180.) * 0.6 = 15.236215
-  //   60.98 cm - 45.2 cm - cos(25.*acos(-1.)/180.) * 0.6 cm = 15.24 cm
-  //
-  //   15.24 + 38.0 - 7.7 - 0.4 = 45.14
-  //   15.24 cm + 38.0 cm - 7.7 cm - 0.4 cm = 45.14 cm
-  //
-  //   // Laenge       45.1 cm
-  //
-  //   // offset to left side
-  //   38.0 - 7.7 - 0.4 = 29.9
-  //
-  //   // Offset       29.9 cm
-
-  Double_t rmax   = 35.56 / 2.;
-  Double_t rmin   = rmax - 0.3;
-  Double_t length = 45.1;
-  Double_t offset = 29.9;
-
-  TGeoVolume* ctub = gGeoManager->MakeCtub("CTUB", med, rmin, rmax, length / 2., angle1, angle2, nlow[0], nlow[1],
-                                           nlow[2], nhi[0], nhi[1], nhi[2]);
-  ctub->SetLineWidth(2);
-  TGeoTranslation* tctub = new TGeoTranslation("tctub", 0, 0, -offset + length / 2.);
-  top->AddNode(ctub, 1, tctub);
-
-
-  //   from z= -29.9 to z= 15.2 cm
-
-  Double_t rmin1  = 15.9 / 2.;
-  Double_t thick1 = 0.4;
-
-  // upstream cover
-  TGeoVolume* cups = gGeoManager->MakeCtub("CUPS", med, rmin1, rmax, thick1 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  cups->SetLineWidth(2);
-  TGeoTranslation* tups = new TGeoTranslation("tups", 0, 0, -offset - thick1 / 2.);
-  top->AddNode(cups, 1, tups);
-
-
-  // Hoehe                   35.56 cm
-  // Breite   19.62 cm * 2 = 39.24 cm
-  // Dicke                    0.60 mm
-
-  Double_t rmin2  = 5.0 / 2.;
-  Double_t thick2 = 0.6;
-
-  // downstream cover 1
-  TGeoVolume* dwst = gGeoManager->MakeEltu("DWST", med, 39.24 / 2., 35.56 / 2., thick2 / 2.);
-  dwst->SetLineWidth(2);
-  //   TGeoRotation* dwrot = new TGeoRotation();
-  //   dwrot->RotateY(-25.);
-  //   TGeoCombiTrans* tdwst = new TGeoCombiTrans("tdwst", 0, 0, -offset +length +thick2/2., dwrot);
-  TGeoTranslation* tdwst = new TGeoTranslation("tdwst", 0, 0, -offset + length + thick2 / 2.);
-  //   top->AddNode(dwst, 1, tdwst);
-
-
-  //   TGeoVolume *cir1 = gGeoManager->MakeCtub("CIR1", med, 0, 1, 1/2., 0, 360,
-  //					    0, 0,-1, 0, 0, 1);
-  //   cir1->SetLineWidth(2);
-  //   TGeoTranslation* tcir1 = new TGeoTranslation("tcir1", -(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir2 = new TGeoTranslation("tcir2", -(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir3 = new TGeoTranslation("tcir3", +(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir4 = new TGeoTranslation("tcir4", +(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   top->AddNode(cir1, 1, tcir1);
-  //   top->AddNode(cir1, 2, tcir2);
-  //   top->AddNode(cir1, 3, tcir3);
-  //   top->AddNode(cir1, 4, tcir4);
-  //
-  //   TGeoVolume *box1 = gGeoManager->MakeBox("BOX1", med, 11.5/2., 10.0/2.-1., 1/2.);
-  //   box1->SetLineWidth(2);
-  //   TGeoTranslation* tbox1 = new TGeoTranslation("tbox1", 0., 0., 20.);
-  //   top->AddNode(box1, 1, tbox1);
-  //
-  //   TGeoVolume *box2 = gGeoManager->MakeBox("BOX2", med, 11.5/2.-1., 10.0/2., 1/2.);
-  //   box2->SetLineWidth(2);
-  //   TGeoTranslation* tbox2 = new TGeoTranslation("tbox2", 0., 0., 20.);
-  //   top->AddNode(box2, 1, tbox2);
-
-  //   TGeoTranslation* tb1 = new TGeoTranslation("tb1", 0., 0., 0.);
-  //   tb1->RegisterYourself();
-  //   TGeoTranslation* tb2 = new TGeoTranslation("tb2", 0., 0., 0.);
-  //   tb2->RegisterYourself();
-
-  TGeoEltu* dcov = new TGeoEltu(39.24 / 2., 35.56 / 2., thick2 / 2.);
-  dcov->SetName("O");  // shapes need names too
-
-  TGeoBBox* b1 = new TGeoBBox(11.5 / 2., 10.0 / 2., 1 / 2.);
-  //   TGeoBBox *b2         = new TGeoBBox(11.5/2.-1., 10.0/2., 1/2.);
-  b1->SetName("A");  // shapes need names too
-  //   b2->SetName("B");                 // shapes need names too
-
-  TGeoTranslation* tc1 = new TGeoTranslation("tc1", -(11.5 / 2. - 1.), +(10.0 / 2. - 1.), 0.);
-  tc1->RegisterYourself();
-  TGeoTranslation* tc2 = new TGeoTranslation("tc2", -(11.5 / 2. - 1.), -(10.0 / 2. - 1.), 0.);
-  tc2->RegisterYourself();
-  TGeoTranslation* tc3 = new TGeoTranslation("tc3", +(11.5 / 2. - 1.), +(10.0 / 2. - 1.), 0.);
-  tc3->RegisterYourself();
-  TGeoTranslation* tc4 = new TGeoTranslation("tc4", +(11.5 / 2. - 1.), -(10.0 / 2. - 1.), 0.);
-  tc4->RegisterYourself();
-
-  TGeoTranslation* tc5 = new TGeoTranslation("tc5", -10.0, 0., 0.);
-  tc5->RegisterYourself();
-
-  //   TGeoCtub *c1 = new TGeoCtub(0, 1, 1/2., 0, 360, 0, 0,-1, 0, 0, 1);
-  TGeoTube* c1 = new TGeoTube(0.0, 1.0, 0.5);
-  c1->SetName("C");  // shapes need names too
-
-  //   TGeoCompositeShape *cosha =
-  //     new TGeoCompositeShape("cosha", " O - ((A + B + C:tc1 + C:tc2 + C:tc3 + C:tc4):tc5) ");
-  TGeoCompositeShape* cosha = new TGeoCompositeShape("cosha", " O - A:tc5 ");
-
-  TGeoVolume* cutout = new TGeoVolume("cutout", cosha, med);
-  cutout->SetLineColor(kBlue);
-
-  TGeoRotation* dwrot = new TGeoRotation();
-  dwrot->RotateY(-25.);
-  TGeoCombiTrans* tcut = new TGeoCombiTrans("tcut", 0, 0, -offset + length + thick2 / 2., dwrot);
-  //   TGeoTranslation* tcut = new TGeoTranslation("tcut", 0, 0, -offset +length +thick2/2.);
-  top->AddNode(cutout, 1, tcut);
-
-  /*
-   // tan(25 deg) * 5.4 cm = 2.518 cm
-   // tan(25.*acos(-1.)/180.) * 5.4 = 2.5180614
-   // 47.12 - tan(25.*acos(-1.)/180.)*5.4 - 0.6 = 44.0 cm 
-   // Laenge       44.0 cm
-   // Durchmesser   5.4 cm
-   // Wanddicke     0.2 cm
-
-   Double_t rmax3   =  5.4 /2.;
-   Double_t rmin3   =  rmax3-0.2;
-   Double_t length3 = 44.0;
-
-   // downstream pipe 
-   TGeoVolume *cpip = gGeoManager->MakeCtub("CPIP", med, rmin2, rmax3, length3/2., angle1, angle2,
-					    -nhi[0],-nhi[1],-nhi[2],-nlow[0],-nlow[1],-nlow[2]);
-   cpip->SetLineWidth(2);
-   TGeoTranslation* tpip = new TGeoTranslation("tpip", 0, 0, -offset +length +thick2 +length3/2.);
-   top->AddNode(cpip, 1, tpip);
-*/
-
-  gGeoManager->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoManager->CheckOverlaps(0.001);
-
-  top->Draw();
-  TView* view = gPad->GetView();
-  view->ShowAxis();
-}
diff --git a/macro/mcbm/geometry/targetbox/targetbox1.C b/macro/mcbm/geometry/targetbox/targetbox1.C
deleted file mode 100644
index f722f4ba7e..0000000000
--- a/macro/mcbm/geometry/targetbox/targetbox1.C
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-// from the following website
-// https://root.cern.ch/doc/master/classTGeoCtub.html
-
-void targetbox1()
-{
-  TCanvas* c = new TCanvas("c", "c", 0, 0, 600, 600);
-  new TGeoManager("ctub", "poza3");
-  TGeoMaterial* mat = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* med   = new TGeoMedium("MED", 1, mat);
-  TGeoVolume* top   = gGeoManager->MakeBox("TOP", med, 100, 100, 100);
-  gGeoManager->SetTopVolume(top);
-
-  Double_t angle1 = 190;
-  Double_t angle2 = 170;
-
-  //   Double_t angle1 =   0;
-  //   Double_t angle2 = 360;
-
-  Double_t theta = 160. * TMath::Pi() / 180.;
-  Double_t phi   = 30. * TMath::Pi() / 180.;
-
-  Double_t nlow[3];
-  nlow[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nlow[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nlow[2] = TMath::Cos(theta);
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  cout << "2 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-
-  //   theta = 20.*TMath::Pi()/180.;
-  //   phi   = 60.*TMath::Pi()/180.;
-  theta = 25. * TMath::Pi() / 180.;
-  phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  cout << "3 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // TGeoVolume *ctub = gGeoManager->MakeCtub("CTUB", med, 25, 27, 30, 200, 160, nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-
-
-  //   // Durchmesser   35.56 cm
-  //   // Wanddicke      0.3 cm
-  //
-  //   // 0.4 + 53.31 + cos(25.*acos(-1.)/180.) * 0.6 = 54.25 cm
-  //
-  //   53.31 cm - tan(25.*acos(-1.)/180.) * 17.78 cm = 45.019050 cm
-
-  //   // check
-  //   60.98 - 45.2 - cos(25.*acos(-1.)/180.) * 0.6 = 15.236215
-  //   60.98 cm - 45.2 cm - cos(25.*acos(-1.)/180.) * 0.6 cm = 15.24 cm
-  //
-  //   15.24 + 38.0 - 7.7 - 0.4 = 45.14
-  //   15.24 cm + 38.0 cm - 7.7 cm - 0.4 cm = 45.14 cm
-  //
-  //   // Laenge       45.1 cm
-  //
-  //   // offset to left side
-  //   38.0 - 7.7 - 0.4 = 29.9
-  //
-  //   // Offset       29.9 cm
-
-  Double_t rmax   = 35.56 / 2.;
-  Double_t rmin   = rmax - 0.3;
-  Double_t length = 45.1;
-  Double_t offset = 29.9;
-
-  TGeoVolume* ctub = gGeoManager->MakeCtub("CTUB", med, rmin, rmax, length / 2., angle1, angle2, nlow[0], nlow[1],
-                                           nlow[2], nhi[0], nhi[1], nhi[2]);
-  ctub->SetLineWidth(2);
-  TGeoTranslation* tctub = new TGeoTranslation("tctub", 0, 0, -offset + length / 2.);
-  top->AddNode(ctub, 1, tctub);
-
-
-  //   from z= -29.9 to z= 15.2 cm
-
-  Double_t rmin1  = 15.9 / 2.;
-  Double_t thick1 = 0.4;
-
-  // upstream cover
-  TGeoVolume* cups = gGeoManager->MakeCtub("CUPS", med, rmin1, rmax, thick1 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  cups->SetLineWidth(2);
-  TGeoTranslation* tups = new TGeoTranslation("tups", 0, 0, -offset - thick1 / 2.);
-  top->AddNode(cups, 1, tups);
-
-
-  // Hoehe                   35.56 cm
-  // Breite   19.62 cm * 2 = 39.24 cm
-  // Dicke                    0.60 mm
-
-  Double_t rmin2  = 5.0 / 2.;
-  Double_t thick2 = 0.6;
-
-  // downstream cover 1
-  //   TGeoVolume *dwst = gGeoManager->MakeEltu("DWST", med, 39.24/2., 35.56/2., thick2/2.);
-  //   dwst->SetLineWidth(2);
-  //   TGeoRotation* dwrot = new TGeoRotation();
-  //   dwrot->RotateY(-25.);
-  //   TGeoCombiTrans* tdwst = new TGeoCombiTrans("tdwst", 0, 0, -offset +length +thick2/2., dwrot);
-  //   TGeoTranslation* tdwst = new TGeoTranslation("tdwst", 0, 0, -offset +length +thick2/2.);
-  //   top->AddNode(dwst, 1, tdwst);
-
-
-  // downstream cover 2
-  TGeoVolume* cdown = gGeoManager->MakeCtub("CDOWN", med, rmin2, rmax, thick2 / 2., angle1, angle2, -nhi[0], -nhi[1],
-                                            -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetLineWidth(2);
-  TGeoTranslation* tdown = new TGeoTranslation("tdown", 0, 0, -offset + length + thick2 / 2.);
-  top->AddNode(cdown, 1, tdown);
-
-
-  // tan(25 deg) * 5.4 cm = 2.518 cm
-  // tan(25.*acos(-1.)/180.) * 5.4 = 2.5180614
-  // 47.12 - tan(25.*acos(-1.)/180.)*5.4 - 0.6 = 44.0 cm
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  Double_t rmax3   = 5.4 / 2.;
-  Double_t rmin3   = rmax3 - 0.2;
-  Double_t length3 = 44.0;
-
-
-  // downstream pipe
-  TGeoVolume* cpip = gGeoManager->MakeCtub("CPIP", med, rmin2, rmax3, length3 / 2., angle1, angle2, -nhi[0], -nhi[1],
-                                           -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  cpip->SetLineWidth(2);
-  TGeoTranslation* tpip = new TGeoTranslation("tpip", 0, 0, -offset + length + thick2 + length3 / 2.);
-  top->AddNode(cpip, 1, tpip);
-
-
-  gGeoManager->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoManager->CheckOverlaps(0.001);
-
-  top->Draw();
-  TView* view = gPad->GetView();
-  view->ShowAxis();
-}
diff --git a/macro/mcbm/geometry/targetbox/targetbox2.C b/macro/mcbm/geometry/targetbox/targetbox2.C
deleted file mode 100644
index b16fb20777..0000000000
--- a/macro/mcbm/geometry/targetbox/targetbox2.C
+++ /dev/null
@@ -1,333 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-// from the following website
-// https://root.cern.ch/doc/master/classTGeoCtub.html
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-void targetbox2()
-{
-  TCanvas* c = new TCanvas("c", "c", 0, 0, 600, 600);
-  new TGeoManager("targetbox", "mCBM targetbox");
-
-  TGeoMaterial* mat = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* med   = new TGeoMedium("MED", 1, mat);
-  TGeoVolume* top   = gGeoManager->MakeBox("top", med, 100, 100, 100);
-  gGeoManager->SetTopVolume(top);
-
-  //   Double_t angle1 = 180;  // lower half
-  //   Double_t angle2 =   0;  // lower half
-
-  //   Double_t angle1 = 190;  // open cut @ -x
-  //   Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // full object
-  Double_t angle2 = 360;  // full object
-
-  Double_t theta = 160. * TMath::Pi() / 180.;
-  Double_t phi   = 30. * TMath::Pi() / 180.;
-
-  Double_t nlow[3];
-  nlow[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nlow[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nlow[2] = TMath::Cos(theta);
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  cout << "2 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-
-  //   theta = 20.*TMath::Pi()/180.;
-  //   phi   = 60.*TMath::Pi()/180.;
-  theta = 25. * TMath::Pi() / 180.;
-  phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  cout << "3 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // TGeoVolume *ctub = gGeoManager->MakeCtub("CTUB", med, 25, 27, 30, 200, 160, nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-
-
-  //   // Durchmesser   35.56 cm
-  //   // Wanddicke      0.3 cm
-  //
-  //   // 0.4 + 53.31 + cos(25.*acos(-1.)/180.) * 0.6 = 54.25 cm
-  //
-  //   53.31 cm - tan(25.*acos(-1.)/180.) * 17.78 cm = 45.019050 cm
-
-  //   // check
-  //   60.98 - 45.2 - cos(25.*acos(-1.)/180.) * 0.6 = 15.236215
-  //   60.98 cm - 45.2 cm - cos(25.*acos(-1.)/180.) * 0.6 cm = 15.24 cm
-  //
-  //   15.24 + 38.0 - 7.7 - 0.4 = 45.14
-  //   15.24 cm + 38.0 cm - 7.7 cm - 0.4 cm = 45.14 cm
-  //
-  //   // Laenge       45.1 cm
-  //
-  //   // offset to left side
-  //   38.0 - 7.7 - 0.4 = 29.9
-  //
-  //   // Offset       29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20 = gGeoManager->MakeCtub("pipe20", med, rmin20, rmax20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vpipe20->SetLineWidth(2);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  top->AddNode(vpipe20, 1, tra20);
-
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", med, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vwall21->SetLineWidth(2);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  top->AddNode(vwall21, 1, tra21);
-
-  // DE   // Hoehe                   35.56 cm
-  // DE   // Breite   19.62 cm * 2 = 39.24 cm
-  // DE   // Dicke                    0.60 mm
-  // DE
-  // DE
-  // DE    // downstream cover 1
-  // DE //   TGeoVolume *dwst = gGeoManager->MakeEltu("DWST", med, 39.24/2., 35.56/2., length2/2.);
-  // DE //   dwst->SetLineWidth(2);
-  // DE //   TGeoRotation* dwrot = new TGeoRotation();
-  // DE //   dwrot->RotateY(-25.);
-  // DE //   TGeoCombiTrans* tdwst = new TGeoCombiTrans("tdwst", 0, 0, -offset20 +length20 +length2/2., dwrot);
-  // DE //   TGeoTranslation* tdwst = new TGeoTranslation("tdwst", 0, 0, -offset20 +length20 +length2/2.);
-  // DE //   top->AddNode(dwst, 1, tdwst);
-  // DE
-  // DE
-
-  // DE2   // downstream cover 2
-  // DE2    TGeoVolume *cdown = gGeoManager->MakeCtub("CDOWN", med, rmin2, rmax20, length2/2., angle1, angle2,
-  // DE2 					    -nhi[0],-nhi[1],-nhi[2], nhi[0], nhi[1], nhi[2]);
-  // DE2    cdown->SetLineWidth(2);
-  // DE2    TGeoTranslation* tdown = new TGeoTranslation("tdown", 0, 0, -offset20 +length20 +length2/2.);
-  // DE2    top->AddNode(cdown, 1, tdown);
-
-
-  //=======================================================================================
-
-  // Hoehe                   35.56 cm
-  // Breite   19.62 cm * 2 = 39.24 cm
-  // Dicke                    0.60 mm
-
-  //   Double_t rmin2   =  5.0 /2.;
-  //   Double_t length2  =  0.6;
-
-  //   // downstream cover 1
-  //   TGeoVolume *dwst = gGeoManager->MakeEltu("DWST", med, 39.24/2., 35.56/2., length2/2.);
-  //   dwst->SetLineWidth(2);
-  //   //   TGeoRotation* dwrot = new TGeoRotation();
-  //   //   dwrot->RotateY(-25.);
-  //   //   TGeoCombiTrans* tdwst = new TGeoCombiTrans("tdwst", 0, 0, -offset20 +length20 +length2/2., dwrot);
-  //   TGeoTranslation* tdwst = new TGeoTranslation("tdwst", 0, 0, -offset20 +length20 +length2/2.);
-  //   top->AddNode(dwst, 1, tdwst);
-
-
-  //   TGeoVolume *cir1 = gGeoManager->MakeCtub("CIR1", med, 0, 1, 1/2., 0, 360,
-  //					    0, 0,-1, 0, 0, 1);
-  //   cir1->SetLineWidth(2);
-  //   TGeoTranslation* tcir1 = new TGeoTranslation("tcir1", -(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir2 = new TGeoTranslation("tcir2", -(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir3 = new TGeoTranslation("tcir3", +(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir4 = new TGeoTranslation("tcir4", +(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   top->AddNode(cir1, 1, tcir1);
-  //   top->AddNode(cir1, 2, tcir2);
-  //   top->AddNode(cir1, 3, tcir3);
-  //   top->AddNode(cir1, 4, tcir4);
-  //
-  //   TGeoVolume *box1 = gGeoManager->MakeBox("BOX1", med, 11.5/2., 10.0/2.-1., 1/2.);
-  //   box1->SetLineWidth(2);
-  //   TGeoTranslation* tbox1 = new TGeoTranslation("tbox1", 0., 0., 20.);
-  //   top->AddNode(box1, 1, tbox1);
-  //
-  //   TGeoVolume *box2 = gGeoManager->MakeBox("BOX2", med, 11.5/2.-1., 10.0/2., 1/2.);
-  //   box2->SetLineWidth(2);
-  //   TGeoTranslation* tbox2 = new TGeoTranslation("tbox2", 0., 0., 20.);
-  //   top->AddNode(box2, 1, tbox2);
-
-  //   TGeoTranslation* tb1 = new TGeoTranslation("tb1", 0., 0., 0.);
-  //   tb1->RegisterYourself();
-  //   TGeoTranslation* tb2 = new TGeoTranslation("tb2", 0., 0., 0.);
-  //   tb2->RegisterYourself();
-
-  //   TGeoEltu *dcov = new TGeoEltu(39.24/2., 35.56/2., length2/2.);
-  //   dcov->SetName("O");                 // shapes need names too
-
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  //   TGeoTranslation* tcut = new TGeoTranslation("tcut", -10.0, 0., 0.);
-  //   TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut", -10.0, 0., 0., rot22);
-  TGeoCombiTrans* tcut =
-    new TGeoCombiTrans("tcut", cos(25. * acos(-1.) / 180.) * -10.0, 0., sin(25. * acos(-1.) / 180.) * -10.0, rot22);
-  tcut->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoCombiTrans* tfra =
-    new TGeoCombiTrans("tfra", cos(25. * acos(-1.) / 180.) * -10.0 - sin(25. * acos(-1.) / 180.) * fthick22, 0.,
-                       sin(25. * acos(-1.) / 180.) * -10.0 + cos(25. * acos(-1.) / 180.) * fthick22
-                         - 0.0001,  // 0.0001 avoids optical error
-                       rot22);
-  tfra->RegisterYourself();
-
-  //   TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut");
-  //   TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O + F:tfra");
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O + F:tfra - A:tcut");
-
-  TGeoVolume* vpipe22 = new TGeoVolume("wall22", compsha, med);
-
-  TGeoTranslation* tra22 = new TGeoTranslation("tra22", 0, 0, -offset20 + length20 + length22 / 2.);
-  top->AddNode(vpipe22, 1, tra22);
-
-  //   // test the thickness
-  //   TGeoRotation* back22 = new TGeoRotation();
-  //   back22->RotateY(+25.);
-  //   TGeoCombiTrans* ztra22 = new TGeoCombiTrans("ztra22", 0, 0, +0.6/2., back22);
-  //   top->AddNode(vpipe22, 1, ztra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23 = gGeoManager->MakeTube("shaft23", med, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  tube23->SetLineWidth(2);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  top->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24 = gGeoManager->MakeTube("shaft24", med, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  tube24->SetLineWidth(2);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  top->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", med, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vpipe10->SetLineWidth(2);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  top->AddNode(vpipe10, 1, tra10);
-
-
-  // upstream flange
-
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", med, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vfla11->SetLineWidth(2);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  top->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // tan(25 deg) * 5.4 cm = 2.518 cm
-  // tan(25.*acos(-1.)/180.) * 5.4 = 2.5180614
-  // 47.12 - tan(25.*acos(-1.)/180.)*5.4 - 0.6 = 44.0 cm
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30 = gGeoManager->MakeCtub("pipe30", med, rmin30, rmax30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vpipe30->SetLineWidth(2);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  top->AddNode(vpipe30, 1, tra30);
-
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", med, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vfla31->SetLineWidth(2);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  top->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  gGeoManager->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoManager->CheckOverlaps(0.001);
-
-  top->Draw();
-
-  //   TView *view = gPad->GetView();
-  //   view->ShowAxis();
-}
diff --git a/macro/mcbm/geometry/targetbox/targetbox3.C b/macro/mcbm/geometry/targetbox/targetbox3.C
deleted file mode 100644
index 8bcd63f18b..0000000000
--- a/macro/mcbm/geometry/targetbox/targetbox3.C
+++ /dev/null
@@ -1,354 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-// from the following website
-// https://root.cern.ch/doc/master/classTGeoCtub.html
-
-// dimensions from z = -38.0 cm to z = +59.8 cm
-// dimensions of core [-29.9 cm .. +15.2 cm]
-// dimensions of sections -38.0 cm | + 7.7 + 0.4 + 45.1 + 0.6 + 44.0 | +59.8 cm
-
-void targetbox3()
-{
-  TCanvas* c = new TCanvas("c", "c", 0, 0, 600, 600);
-  new TGeoManager("targetbox", "mCBM targetbox");
-
-  TGeoMaterial* mat = new TGeoMaterial("Al", 26.98, 13, 2.7);
-  TGeoMedium* med   = new TGeoMedium("MED", 1, mat);
-  TGeoVolume* top   = gGeoManager->MakeBox("top", med, 100, 100, 100);
-  gGeoManager->SetTopVolume(top);
-
-  //   Double_t angle1 = 180;  // lower half
-  //   Double_t angle2 =   0;  // lower half
-
-  //   Double_t angle1 = 190;  // open cut @ -x
-  //   Double_t angle2 = 170;  // open cut @ -x
-
-  Double_t angle1 = 0;    // full object
-  Double_t angle2 = 360;  // full object
-
-  Double_t theta = 160. * TMath::Pi() / 180.;
-  Double_t phi   = 30. * TMath::Pi() / 180.;
-
-  Double_t nlow[3];
-  nlow[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nlow[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nlow[2] = TMath::Cos(theta);
-
-  cout << "1 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-  nlow[0] = 0;
-  nlow[1] = 0;
-  nlow[2] = -1;
-
-  cout << "2 - lx: " << nlow[0] << " ly: " << nlow[1] << " lz: " << nlow[2] << endl;
-
-
-  //   theta = 20.*TMath::Pi()/180.;
-  //   phi   = 60.*TMath::Pi()/180.;
-  theta = 25. * TMath::Pi() / 180.;
-  phi   = 180. * TMath::Pi() / 180.;
-
-  Double_t nhi[3];
-  nhi[0] = TMath::Sin(theta) * TMath::Cos(phi);
-  nhi[1] = TMath::Sin(theta) * TMath::Sin(phi);
-  nhi[2] = TMath::Cos(theta);
-
-  cout << "3 - hx: " << nhi[0] << " hy: " << nhi[1] << " hz: " << nhi[2] << endl;
-
-  // TGeoVolume *ctub = gGeoManager->MakeCtub("CTUB", med, 25, 27, 30, 200, 160, nlow[0], nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-
-
-  //   // Durchmesser   35.56 cm
-  //   // Wanddicke      0.3 cm
-  //
-  //   // 0.4 + 53.31 + cos(25.*acos(-1.)/180.) * 0.6 = 54.25 cm
-  //
-  //   53.31 cm - tan(25.*acos(-1.)/180.) * 17.78 cm = 45.019050 cm
-
-  //   // check
-  //   60.98 - 45.2 - cos(25.*acos(-1.)/180.) * 0.6 = 15.236215
-  //   60.98 cm - 45.2 cm - cos(25.*acos(-1.)/180.) * 0.6 cm = 15.24 cm
-  //
-  //   15.24 + 38.0 - 7.7 - 0.4 = 45.14
-  //   15.24 cm + 38.0 cm - 7.7 cm - 0.4 cm = 45.14 cm
-  //
-  //   // Laenge       45.1 cm
-  //
-  //   // offset to left side
-  //   38.0 - 7.7 - 0.4 = 29.9
-  //
-  //   // Offset       29.9 cm
-
-  Double_t rmax20   = 35.56 / 2.;
-  Double_t rmin20   = rmax20 - 0.3;
-  Double_t length20 = 45.1;
-  Double_t offset20 = 29.9;
-
-  TGeoVolume* vpipe20 = gGeoManager->MakeCtub("pipe20", med, rmin20, rmax20, length20 / 2., angle1, angle2, nlow[0],
-                                              nlow[1], nlow[2], nhi[0], nhi[1], nhi[2]);
-  vpipe20->SetLineWidth(2);
-  TGeoTranslation* tra20 = new TGeoTranslation("tra20", 0, 0, -offset20 + length20 / 2.);
-  top->AddNode(vpipe20, 1, tra20);
-
-
-  // upstream cover
-  Double_t rmax21   = rmax20;
-  Double_t rmin21   = 15.9 / 2.;
-  Double_t length21 = 0.4;
-
-  TGeoVolume* vwall21 =
-    gGeoManager->MakeCtub("wall21", med, rmin21, rmax21, length21 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vwall21->SetLineWidth(2);
-  TGeoTranslation* tra21 = new TGeoTranslation("tra21", 0, 0, -offset20 - length21 / 2.);
-  top->AddNode(vwall21, 1, tra21);
-
-  // DE   // Hoehe                   35.56 cm
-  // DE   // Breite   19.62 cm * 2 = 39.24 cm
-  // DE   // Dicke                    0.60 mm
-  // DE
-  // DE
-  // DE    // downstream cover 1
-  // DE //   TGeoVolume *dwst = gGeoManager->MakeEltu("DWST", med, 39.24/2., 35.56/2., length2/2.);
-  // DE //   dwst->SetLineWidth(2);
-  // DE //   TGeoRotation* dwrot = new TGeoRotation();
-  // DE //   dwrot->RotateY(-25.);
-  // DE //   TGeoCombiTrans* tdwst = new TGeoCombiTrans("tdwst", 0, 0, -offset20 +length20 +length2/2., dwrot);
-  // DE //   TGeoTranslation* tdwst = new TGeoTranslation("tdwst", 0, 0, -offset20 +length20 +length2/2.);
-  // DE //   top->AddNode(dwst, 1, tdwst);
-  // DE
-  // DE
-
-  // DE2   // downstream cover 2
-  // DE2    TGeoVolume *cdown = gGeoManager->MakeCtub("CDOWN", med, rmin2, rmax20, length2/2., angle1, angle2,
-  // DE2 					    -nhi[0],-nhi[1],-nhi[2], nhi[0], nhi[1], nhi[2]);
-  // DE2    cdown->SetLineWidth(2);
-  // DE2    TGeoTranslation* tdown = new TGeoTranslation("tdown", 0, 0, -offset20 +length20 +length2/2.);
-  // DE2    top->AddNode(cdown, 1, tdown);
-
-
-  //=======================================================================================
-
-  // Hoehe                   35.56 cm
-  // Breite   19.62 cm * 2 = 39.24 cm
-  // Dicke                    0.60 mm
-
-  //   Double_t rmin2   =  5.0 /2.;
-  //   Double_t length2  =  0.6;
-
-  //   // downstream cover 1
-  //   TGeoVolume *dwst = gGeoManager->MakeEltu("DWST", med, 39.24/2., 35.56/2., length2/2.);
-  //   dwst->SetLineWidth(2);
-  //   //   TGeoRotation* dwrot = new TGeoRotation();
-  //   //   dwrot->RotateY(-25.);
-  //   //   TGeoCombiTrans* tdwst = new TGeoCombiTrans("tdwst", 0, 0, -offset20 +length20 +length2/2., dwrot);
-  //   TGeoTranslation* tdwst = new TGeoTranslation("tdwst", 0, 0, -offset20 +length20 +length2/2.);
-  //   top->AddNode(dwst, 1, tdwst);
-
-
-  //   TGeoVolume *cir1 = gGeoManager->MakeCtub("CIR1", med, 0, 1, 1/2., 0, 360,
-  //					    0, 0,-1, 0, 0, 1);
-  //   cir1->SetLineWidth(2);
-  //   TGeoTranslation* tcir1 = new TGeoTranslation("tcir1", -(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir2 = new TGeoTranslation("tcir2", -(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir3 = new TGeoTranslation("tcir3", +(11.5/2.-1.), +(10.0/2.-1.), 20.);
-  //   TGeoTranslation* tcir4 = new TGeoTranslation("tcir4", +(11.5/2.-1.), -(10.0/2.-1.), 20.);
-  //   top->AddNode(cir1, 1, tcir1);
-  //   top->AddNode(cir1, 2, tcir2);
-  //   top->AddNode(cir1, 3, tcir3);
-  //   top->AddNode(cir1, 4, tcir4);
-  //
-  //   TGeoVolume *box1 = gGeoManager->MakeBox("BOX1", med, 11.5/2., 10.0/2.-1., 1/2.);
-  //   box1->SetLineWidth(2);
-  //   TGeoTranslation* tbox1 = new TGeoTranslation("tbox1", 0., 0., 20.);
-  //   top->AddNode(box1, 1, tbox1);
-  //
-  //   TGeoVolume *box2 = gGeoManager->MakeBox("BOX2", med, 11.5/2.-1., 10.0/2., 1/2.);
-  //   box2->SetLineWidth(2);
-  //   TGeoTranslation* tbox2 = new TGeoTranslation("tbox2", 0., 0., 20.);
-  //   top->AddNode(box2, 1, tbox2);
-
-  //   TGeoTranslation* tb1 = new TGeoTranslation("tb1", 0., 0., 0.);
-  //   tb1->RegisterYourself();
-  //   TGeoTranslation* tb2 = new TGeoTranslation("tb2", 0., 0., 0.);
-  //   tb2->RegisterYourself();
-
-  //   TGeoEltu *dcov = new TGeoEltu(39.24/2., 35.56/2., length2/2.);
-  //   dcov->SetName("O");                 // shapes need names too
-
-  Double_t rmax22   = rmax20;
-  Double_t rmin22   = 5.4 / 2.;
-  Double_t length22 = 0.6 / cos(25. * acos(-1.) / 180.);
-
-  TGeoCtub* cdown =
-    new TGeoCtub(rmin22, rmax22, length22 / 2., angle1, angle2, -nhi[0], -nhi[1], -nhi[2], nhi[0], nhi[1], nhi[2]);
-  cdown->SetName("O");  // shapes need names too
-
-  // kapton foil frame dimensions - inner dimensions - frame width
-  // x/y/z - 13.9/12.4/0.6 cm     - 11.5/10.0 cm     - 1.2 cm
-
-  // corner of pipe at
-  // x = -2.70
-  // z = 14.54 = tan(25.*acos(-1.)/180.) * -5.4/2. + 15.8
-
-  // corner of frame towards beampipe
-  // x = -3.74
-  // z = 14.06
-  // distance = sqrt( 1.04 * 1.04 + 0.48 * 0.48 ) = 1.14 cm
-
-  // rotate forward
-  TGeoRotation* rot22 = new TGeoRotation();
-  rot22->RotateY(-25.);
-  TGeoCombiTrans* frot22 = new TGeoCombiTrans("frot22", 0, 0, 0, rot22);
-  frot22->RegisterYourself();
-
-  // rotate back
-  TGeoRotation* back22 = new TGeoRotation();
-  back22->RotateY(+25.);
-  TGeoCombiTrans* brot22 = new TGeoCombiTrans("brot22", 0, 0, 0, back22);
-  brot22->RegisterYourself();
-
-
-  TGeoBBox* box22 = new TGeoBBox(11.5 / 2., 10.0 / 2., 2.0 / 2.);
-  box22->SetName("A");  // shapes need names too
-
-  TGeoTranslation* tcut1 = new TGeoTranslation("tcut1", -10.0, 0., 0.);
-  tcut1->RegisterYourself();
-
-  //   //   TGeoCombiTrans*  tcut = new TGeoCombiTrans("tcut", -10.0, 0., 0., rot22);
-  //   TGeoCombiTrans*  tcut2 = new TGeoCombiTrans("tcut2",
-  //                            cos(25.*acos(-1.)/180.) * -10.0,
-  //			    0.,
-  //			    sin(25.*acos(-1.)/180.) * -10.0,
-  //			    rot22);
-  //   tcut2->RegisterYourself();
-
-  Double_t fthick22 = 0.6;
-  TGeoBBox* frame22 = new TGeoBBox(13.9 / 2., 12.4 / 2., fthick22 / 2.);
-  frame22->SetName("F");  // shapes need names too
-
-  TGeoTranslation* tfra1 = new TGeoTranslation("tfra1", -10.0, 0., fthick22 - 0.0001);
-  tfra1->RegisterYourself();
-
-  //   TGeoCombiTrans*  tfra2 = new TGeoCombiTrans("tfra2",
-  //                           cos(25.*acos(-1.)/180.) * -10.0 - sin(25.*acos(-1.)/180.) * fthick22,
-  //           		   0.,
-  //			   sin(25.*acos(-1.)/180.) * -10.0 + cos(25.*acos(-1.)/180.) * fthick22 - 0.0001,  // 0.0001 avoids optical error
-  //			   rot22);
-  //   tfra2->RegisterYourself();
-
-  //   TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O - A:tcut2");
-  //   TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O + F:tfra2");
-  //   TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O + F:tfra2 - A:tcut2");
-  //
-  //   TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O:brot22 + A:tcut2");
-  //   TGeoCompositeShape *compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1");
-  TGeoCompositeShape* compsha = new TGeoCompositeShape("compsha", "O:brot22 + F:tfra1 - A:tcut1");
-
-  TGeoVolume* vpipe22 = new TGeoVolume("wall22", compsha, med);
-
-  TGeoCombiTrans* tra22 = new TGeoCombiTrans("tra22", 0, 0, -offset20 + length20 + length22 / 2., rot22);
-  top->AddNode(vpipe22, 1, tra22);
-
-  //   TGeoTranslation* ztra22 = new TGeoTranslation("ztra22", 0, 0, 0);
-  //   TGeoCombiTrans* ztra22 = new TGeoCombiTrans("ztra22", 0, 0, 0, back22);
-  //   TGeoCombiTrans* ztra22 = new TGeoCombiTrans("ztra22", 0, 0, +0.6/2., back22);
-  //   top->AddNode(vpipe22, 1, ztra22);
-
-  //=======================================================================================
-
-  // vertical tubes
-  Double_t height23   = 28.0 - 17.8;
-  TGeoRotation* rot23 = new TGeoRotation();
-  rot23->RotateX(90.);
-
-  // target tube
-  TGeoVolume* tube23 = gGeoManager->MakeTube("shaft23", med, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  tube23->SetLineWidth(2);
-  TGeoCombiTrans* tra23 = new TGeoCombiTrans("tra23", 0, 28.0 - height23 / 2., 0, rot23);
-  top->AddNode(tube23, 1, tra23);
-
-  // diamond tube
-  TGeoVolume* tube24 = gGeoManager->MakeTube("shaft24", med, 10.4 / 2., 10.8 / 2., height23 / 2.);
-  tube24->SetLineWidth(2);
-  TGeoCombiTrans* tra24 = new TGeoCombiTrans("tra24", 0, 28.0 - height23 / 2., -20.0, rot23);
-  top->AddNode(tube24, 1, tra24);
-
-  //=======================================================================================
-
-  // upstream pipe
-  Double_t rmax10   = 15.9 / 2.;
-  Double_t rmin10   = rmax10 - 0.2;
-  Double_t length10 = 7.7 + length21;
-
-  TGeoVolume* vpipe10 =
-    gGeoManager->MakeCtub("pipe10", med, rmin10, rmax10, length10 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vpipe10->SetLineWidth(2);
-  TGeoTranslation* tra10 = new TGeoTranslation("tra10", 0, 0, -offset20 - length10 / 2.);
-  top->AddNode(vpipe10, 1, tra10);
-
-
-  // upstream flange
-
-  // size of flange
-  // Diameter  19.9 cm
-  // Thickness  1.8 cm
-
-  Double_t rmax11   = 19.9 / 2.;
-  Double_t rmin11   = rmax10;
-  Double_t length11 = 1.8;
-
-  TGeoVolume* vfla11 =
-    gGeoManager->MakeCtub("flange11", med, rmin11, rmax11, length11 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vfla11->SetLineWidth(2);
-  TGeoTranslation* tra11 = new TGeoTranslation("tra11", 0, 0, -offset20 - length10 + length11 / 2.);
-  top->AddNode(vfla11, 1, tra11);
-
-  //=======================================================================================
-
-  // tan(25 deg) * 5.4 cm = 2.518 cm
-  // tan(25.*acos(-1.)/180.) * 5.4 = 2.5180614
-  // 47.12 - tan(25.*acos(-1.)/180.)*5.4 - 0.6 = 44.0 cm
-  // Laenge       44.0 cm
-  // Durchmesser   5.4 cm
-  // Wanddicke     0.2 cm
-
-  // downstream pipe
-  Double_t rmax30   = 5.4 / 2.;
-  Double_t rmin30   = rmax30 - 0.2;
-  Double_t length30 = 44.0 + 0.6;
-
-  TGeoVolume* vpipe30 = gGeoManager->MakeCtub("pipe30", med, rmin30, rmax30, length30 / 2., angle1, angle2, -nhi[0],
-                                              -nhi[1], -nhi[2], -nlow[0], -nlow[1], -nlow[2]);
-  vpipe30->SetLineWidth(2);
-  TGeoTranslation* tra30 = new TGeoTranslation("tra30", 0, 0, -offset20 + length20 + length30 / 2.);
-  top->AddNode(vpipe30, 1, tra30);
-
-
-  // size of flange
-  // Thickness  1.8 cm
-  // Diameter  11.4 cm
-
-  Double_t rmax40   = 11.4 / 2.;
-  Double_t rmin40   = rmax30;
-  Double_t length40 = 1.8;
-
-  // downstream flange
-  TGeoVolume* vfla31 =
-    gGeoManager->MakeCtub("flange31", med, rmin40, rmax40, length40 / 2., angle1, angle2, 0, 0, -1, 0, 0, 1);
-  vfla31->SetLineWidth(2);
-  TGeoTranslation* fla31 = new TGeoTranslation("fla31", 0, 0, -offset20 + length20 + length30 - length40 / 2.);
-  top->AddNode(vfla31, 1, fla31);
-
-  //=======================================================================================
-
-  gGeoManager->CloseGeometry();
-  gGeoManager->SetNsegments(80);
-  gGeoManager->CheckOverlaps(0.001);
-
-  top->Draw();
-
-  //   TView *view = gPad->GetView();
-  //   view->ShowAxis();
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_mCBM_1.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_mCBM_1.C
deleted file mode 100644
index e5904a9167..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_mCBM_1.C
+++ /dev/null
@@ -1,395 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-// Macro creating a ToF geometry for miniCBM
-// derived from Macro creating a ToF geometry for STAR wheel (AKA Create_TOF_Geometry_Star_1.C)
-//
-// Usage:
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14s";
-const TString FileName   = geoVersion + ".root";
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 480;  // -240, positiv for testing in CBMROOT
-// Form automatically phi rotated modules
-const Double_t RING_DelZ   = -13.;  // +13 for STAR
-const Double_t RING_DelPhi = 30.;
-const Double_t Deg2Rad     = 0.017453293;
-const Double_t RING_DPhi   = 10.;
-const Double_t RING_DR     = 5.;
-
-// Counters:
-// 0 conductive glass
-// 1 thin glass
-
-const Int_t NumberOfDifferentCounterTypes            = 2;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {27., 27.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.07, 0.028};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {27., 27.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.022, 0.014};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes]          = {8, 12};
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 34.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {10.0, 10.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3};
-
-const Int_t NofModuleTypes = 1;
-// Aluminum box for all supermodule types
-// 0 default
-
-const Float_t Module_Size_X[NofModuleTypes] = {100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11.};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {1};
-const Int_t NCounterInModule[NofModuleTypes]    = {3};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-31.};
-const Float_t CounterXDistance[NofModuleTypes]      = {31.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5};
-//const Float_t CounterRotationAngle[NofModuleTypes]  = {-8.7}; // for STAR
-const Float_t CounterRotationAngle[NofModuleTypes] = {8.7};  // for CBM
-
-// Position for module placement
-const Float_t Module_X_Position = 170.;
-const Float_t Module_Y_Position = 0.;
-const Float_t Module_Z_Position = Wall_Z_Position;
-
-const Int_t Module_NTypes                 = 1;
-const Float_t Module_Types[Module_NTypes] = {0.};  // Module Type specifier
-//const Float_t Module_Number[Module_NTypes] = {36.}; //debugging,
-// miniCBM
-const Float_t Module_Number[Module_NTypes] = {3.};  //debugging,
-//const Float_t Module_Number[Module_NTypes] = {13.}; // 12 + 1 // debugging
-//const Float_t Module_Number[Module_NTypes] = {25.}; // 24 + 1 // debugging
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-
-void position_tof_modules(Int_t);  // STAR modules
-
-void Create_TOF_Geometry_mCBM_1()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  position_tof_modules(1);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile = new TFile(FileName, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile->Close();
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * (gdz + ggdz) + gdz + 0.2;
-
-  //calculate thickness and first position in coonter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = (-cdz + gdz) / 2.;
-  Float_t startzposgas  = -cdz / 2. + gdz + ggdz / 2.;
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(98);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(98);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap < ngaps; igap++) {
-
-    Float_t zpos_glas = startzposglas + igap * dzpos;
-    Float_t zpos_gas  = startzposgas + igap * dzpos;
-
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    TGeoTranslation* gas_gap_trans     = new TGeoTranslation("", 0., 0., zpos_gas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-  }
-
-  Float_t zpos_glas                  = startzposglas + (ngaps + 1) * dzpos;
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-  counter->AddNode(glass_plate_vol, ngaps, glass_plate_trans);
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kGreen);  // set line color for electronics
-  pcb_vol->SetTransparency(90);   // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(90);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(80);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-
-    zpos = 0.;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-void position_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  Int_t ii        = 0;
-  Float_t xPos    = Module_X_Position;
-  Float_t yPos    = Module_Y_Position;
-  Float_t zPos    = Module_Z_Position;
-  Double_t Radius = TMath::Sqrt(xPos * xPos + yPos * yPos);
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < Module_Number[j]; i++) {
-      ii++;
-      //    if(i==12 || i==24) Radius += RING_DR;
-      if (i == 1 || i == 2) Radius += RING_DR;
-      Int_t iRing = ii;
-      //    Int_t iRing = TMath::Floor(i/12);
-      Double_t Phi_Pos = RING_DelPhi * (i % 12) + RING_DPhi * iRing;
-      Double_t Phi     = Phi_Pos * Deg2Rad;
-      xPos             = 0;
-      yPos             = 0 + ii * 30;
-      //    xPos = Radius*TMath::Cos(Phi);
-      //    yPos = Radius*TMath::Sin(Phi);
-      zPos         = Module_Z_Position - RING_DelZ * iRing;
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      //    TGeoRotation* module_rot = new TGeoRotation();
-      //    module_rot->RotateZ(Phi_Pos);
-      //    TGeoCombiTrans* module_combi_trans = NULL;
-      //    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      //    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-    }
-  }
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_1x.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_1x.C
deleted file mode 100644
index ca45670f89..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_1x.C
+++ /dev/null
@@ -1,1078 +0,0 @@
-/* Copyright (C) 2015-2016 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v13_4x.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2013-10-16 - DE - prepare tof_v13_5a geometry - SIS 100 hadron  : TOF_Z_Front =  450 cm
-// 2013-10-16 - DE - prepare tof_v13_5b geometry - SIS 100 electron: TOF_Z_Front =  600 cm
-// 2013-10-16 - DE - prepare tof_v13_5c geometry - SIS 100 muon    : TOF_Z_Front =  650 cm
-// 2013-10-16 - DE - prepare tof_v13_5d geometry - SIS 300 electron: TOF_Z_Front =  880 cm
-// 2013-10-16 - DE - prepare tof_v13_5e geometry - SIS 300 muon    : TOF_Z_Front = 1020 cm
-// 2013-10-16 - DE - patch pole_alu bug - skip 0 thickness air volume in pole
-// 2013-09-04 - DE - prepare tof_v13_4a geometry - SIS 100 hadron  : TOF_Z_Front =  450 cm
-// 2013-09-04 - DE - prepare tof_v13_4b geometry - SIS 100 electron: TOF_Z_Front =  600 cm
-// 2013-09-04 - DE - prepare tof_v13_4c geometry - SIS 100 muon    : TOF_Z_Front =  650 cm
-// 2013-09-04 - DE - prepare tof_v13_4d geometry - SIS 300 electron: TOF_Z_Front =  880 cm
-// 2013-09-04 - DE - prepare tof_v13_4e geometry - SIS 300 muon    : TOF_Z_Front = 1020 cm
-// 2013-09-04 - DE - dump z-positions to .geo.info file
-// 2013-09-04 - DE - define front z-position of TOF wall (TOF_Z_Front)
-// 2013-09-04 - DE - fix arrangement of glass plates in RPC cells
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v13_5a";
-//const TString geoVersion = "tof_v13-5b";
-//const TString geoVersion = "tof_v13-5c";
-//const TString geoVersion = "tof_v13-5d";
-//const TString geoVersion = "tof_v13-5e";
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 5.;
-const Float_t Module_Thick_Alu_X_right      = 1.;
-const Float_t Module_Thick_Alu_Y            = 1.;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position           = 16.;
-const Float_t Inner_Module_Last_Y_Position            = 480.;
-const Float_t Inner_Module_X_Offset                   = 2.;
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18_1x()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  module_trans = new TGeoTranslation("", xPos, -49 - 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 49 + 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, -26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_2x.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_2x.C
deleted file mode 100644
index 7167aa1505..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_2x.C
+++ /dev/null
@@ -1,1081 +0,0 @@
-/* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v13_4x.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2013-10-16 - DE - prepare tof_v13_5a geometry - SIS 100 hadron  : TOF_Z_Front =  450 cm
-// 2013-10-16 - DE - prepare tof_v13_5b geometry - SIS 100 electron: TOF_Z_Front =  600 cm
-// 2013-10-16 - DE - prepare tof_v13_5c geometry - SIS 100 muon    : TOF_Z_Front =  650 cm
-// 2013-10-16 - DE - prepare tof_v13_5d geometry - SIS 300 electron: TOF_Z_Front =  880 cm
-// 2013-10-16 - DE - prepare tof_v13_5e geometry - SIS 300 muon    : TOF_Z_Front = 1020 cm
-// 2013-10-16 - DE - patch pole_alu bug - skip 0 thickness air volume in pole
-// 2013-09-04 - DE - prepare tof_v13_4a geometry - SIS 100 hadron  : TOF_Z_Front =  450 cm
-// 2013-09-04 - DE - prepare tof_v13_4b geometry - SIS 100 electron: TOF_Z_Front =  600 cm
-// 2013-09-04 - DE - prepare tof_v13_4c geometry - SIS 100 muon    : TOF_Z_Front =  650 cm
-// 2013-09-04 - DE - prepare tof_v13_4d geometry - SIS 300 electron: TOF_Z_Front =  880 cm
-// 2013-09-04 - DE - prepare tof_v13_4e geometry - SIS 300 muon    : TOF_Z_Front = 1020 cm
-// 2013-09-04 - DE - dump z-positions to .geo.info file
-// 2013-09-04 - DE - define front z-position of TOF wall (TOF_Z_Front)
-// 2013-09-04 - DE - fix arrangement of glass plates in RPC cells
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v13_6a";
-//const TString geoVersion = "tof_v13_5a";
-//const TString geoVersion = "tof_v13-5b";
-//const TString geoVersion = "tof_v13-5c";
-//const TString geoVersion = "tof_v13-5d";
-//const TString geoVersion = "tof_v13-5e";
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 130;  // mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 5.;
-const Float_t Module_Thick_Alu_X_right      = 1.;
-const Float_t Module_Thick_Alu_Y            = 1.;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position           = 16.;
-const Float_t Inner_Module_Last_Y_Position            = 480.;
-const Float_t Inner_Module_X_Offset                   = 2.;
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18_2x()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  module_trans = new TGeoTranslation("", xPos, -49 - 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 49 + 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, -26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_3x.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_3x.C
deleted file mode 100644
index 4db524ece5..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18_3x.C
+++ /dev/null
@@ -1,1109 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v13_4x.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-03-17 - DE - add mTOF geometry consisting of 3 TOF STAR modules
-// 2013-10-16 - DE - prepare tof_v13_5a geometry - SIS 100 hadron  : TOF_Z_Front =  450 cm
-// 2013-10-16 - DE - prepare tof_v13_5b geometry - SIS 100 electron: TOF_Z_Front =  600 cm
-// 2013-10-16 - DE - prepare tof_v13_5c geometry - SIS 100 muon    : TOF_Z_Front =  650 cm
-// 2013-10-16 - DE - prepare tof_v13_5d geometry - SIS 300 electron: TOF_Z_Front =  880 cm
-// 2013-10-16 - DE - prepare tof_v13_5e geometry - SIS 300 muon    : TOF_Z_Front = 1020 cm
-// 2013-10-16 - DE - patch pole_alu bug - skip 0 thickness air volume in pole
-// 2013-09-04 - DE - prepare tof_v13_4a geometry - SIS 100 hadron  : TOF_Z_Front =  450 cm
-// 2013-09-04 - DE - prepare tof_v13_4b geometry - SIS 100 electron: TOF_Z_Front =  600 cm
-// 2013-09-04 - DE - prepare tof_v13_4c geometry - SIS 100 muon    : TOF_Z_Front =  650 cm
-// 2013-09-04 - DE - prepare tof_v13_4d geometry - SIS 300 electron: TOF_Z_Front =  880 cm
-// 2013-09-04 - DE - prepare tof_v13_4e geometry - SIS 300 muon    : TOF_Z_Front = 1020 cm
-// 2013-09-04 - DE - dump z-positions to .geo.info file
-// 2013-09-04 - DE - define front z-position of TOF wall (TOF_Z_Front)
-// 2013-09-04 - DE - fix arrangement of glass plates in RPC cells
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v13_7a";
-//const TString geoVersion = "tof_v13_5a";
-//const TString geoVersion = "tof_v13-5b";
-//const TString geoVersion = "tof_v13-5c";
-//const TString geoVersion = "tof_v13-5d";
-//const TString geoVersion = "tof_v13-5e";
-const TString FileNameSim  = "m" + geoVersion + ".geo.root";
-const TString FileNameGeo  = "m" + geoVersion + "_geo.root";
-const TString FileNameInfo = "m" + geoVersion + ".geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 130;  // mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 5.;
-const Float_t Module_Thick_Alu_X_right      = 1.;
-const Float_t Module_Thick_Alu_Y            = 1.;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position           = 16.;
-const Float_t Inner_Module_Last_Y_Position            = 480.;
-const Float_t Inner_Module_X_Offset                   = 2.;
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position = 0.;
-const Float_t Outer_Module_Last_Y_Position  = 480.;
-const Float_t Outer_Module_X_Offset         = 3.;
-const Int_t Outer_Module_Col                = 4;
-const Int_t Outer_Module_NTypes             = 2;
-//const Float_t Outer_Module_Types [Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,1.,1.,  2.,2.,2.,2.};
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9.,9.,2.,0.,  0.,0.,3.,4.};//V13_3a
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0.,
-                                                                            0., 0., 1., 2.};  // DE 2 = 5 modules
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18_3x()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  // DE no inner modules anymore 03/2017
-  //  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(1);
-  //  position_outer_tof_modules(2);
-  //  position_outer_tof_modules(3);
-  position_outer_tof_modules(4);
-  //DE  position_tof_poles(0);
-  //DE  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  module_trans = new TGeoTranslation("", xPos, -49 - 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 49 + 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, -26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  //  for(Int_t j=0; j<nCol; j++){
-  for (Int_t j = 3; j < nCol; j++) {  // DE only plot lagrest modules, not the inner ones
-                                      //   Float_t xPos = Outer_Module_X_Offset + ((j+1)*DxColl);
-    //   Float_t xPos = Outer_Module_X_Offset + ((j+1-3)*DxColl);  // DE reduce offset
-
-    //    Float_t xPos = Outer_Module_X_Offset;
-    Float_t xPos = 7;  // DE for centered position of modules in x
-
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    //DE   zPos -= 2.*DzPos; //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-
-        cout << " DE: xPos " << xPos << endl;
-
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        if (ii == 1)  // print only 1 module upstream
-        {
-          //        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-          module_trans = new TGeoTranslation("", xPos, yPos, zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-        }
-
-        //      module_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-        //      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        //      modNum[modType]++;
-
-        if (ii > 1) {
-          // first layer
-          //	module_trans
-          //	  = new TGeoTranslation("", xPos, -yPos, zPos);
-          //	gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          //	modNum[modType]++;
-          //	module_trans
-          //	  = new TGeoTranslation("", -xPos, -yPos, zPos);
-          //	module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          //	gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          //	modNum[modType]++;
-
-          // second layer
-          //	module_trans = new TGeoTranslation("", xPos, yPos-DeltaY/2., zPos+DzPos);
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          //	module_trans
-          //	  = new TGeoTranslation("", -xPos, yPos-DeltaY/2., zPos+DzPos);
-          //	module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          //	gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          //	modNum[modType]++;
-
-          //	module_trans = new TGeoTranslation("", xPos, -(yPos-DeltaY/2.), zPos+DzPos);
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          //	module_trans
-          //	  = new TGeoTranslation("", -xPos, -(yPos-DeltaY/2.), zPos+DzPos);
-          //	module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          //	gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          //	modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18d_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18d_mcbm.C
deleted file mode 100644
index abed5b5a7c..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18d_mcbm.C
+++ /dev/null
@@ -1,1065 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18d_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14a";  // do not change
-//
-const TString fileTag      = "tof_v18d";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 130;  // mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 5.;
-const Float_t Module_Thick_Alu_X_right      = 1.;
-const Float_t Module_Thick_Alu_Y            = 1.;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position           = 16.;
-const Float_t Inner_Module_Last_Y_Position            = 480.;
-const Float_t Inner_Module_X_Offset                   = 2.;
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18d_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  module_trans = new TGeoTranslation("", xPos, -49 - 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 49 + 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, -26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18e_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18e_mcbm.C
deleted file mode 100644
index 74ef8a3f4e..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18e_mcbm.C
+++ /dev/null
@@ -1,1070 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18e_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14a";  // do not change
-//
-const TString fileTag      = "tof_v18e";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 130;  // mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 5.;
-const Float_t Module_Thick_Alu_X_right      = 1.;
-const Float_t Module_Thick_Alu_Y            = 1.;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position           = 16.;
-const Float_t Inner_Module_Last_Y_Position            = 480.;
-const Float_t Inner_Module_X_Offset                   = 18;  // shift 16 cm to the left side // 2.;
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18e_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateZ(180);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  module_trans = new TGeoTranslation("", xPos, -49 - 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 49 + 3, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, -26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 26, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18f_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18f_mcbm.C
deleted file mode 100644
index 0ec6cac137..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18f_mcbm.C
+++ /dev/null
@@ -1,1075 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18f_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14a";  // do not change
-//
-const TString fileTag      = "tof_v18f";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 130;  // mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 1.0;
-const Float_t Module_Thick_Alu_X_right      = 0.1;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position           = 16.;
-const Float_t Inner_Module_Last_Y_Position            = 480.;
-const Float_t Inner_Module_X_Offset                   = 18;  // shift 16 cm to the left side // 2.;
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18f_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateZ(180);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-  module_trans = new TGeoTranslation("", xPos, -49 - 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
-  module_trans = new TGeoTranslation("", xPos, 49 + 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, -25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, 25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18g_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18g_mcbm.C
deleted file mode 100644
index 1fa4cb4b15..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18g_mcbm.C
+++ /dev/null
@@ -1,1081 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18g_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-15 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14a";  // do not change
-//
-const TString fileTag      = "tof_v18g";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 130;  // mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 1.0;
-const Float_t Module_Thick_Alu_X_right      = 0.1;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position           = 16.;
-const Float_t Inner_Module_Last_Y_Position            = 480.;
-const Float_t Inner_Module_X_Offset                   = 18;  // shift 16 cm to the left side // 2.;
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18g_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateZ(180);
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-  // module_trans = new TGeoTranslation("", xPos, -49-1, zPos);
-  module_trans = new TGeoTranslation("", xPos, -49 - 1, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  module_trans = new TGeoTranslation("", xPos, 0, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
-  // module_trans = new TGeoTranslation("", xPos, 49+1, zPos);
-  module_trans = new TGeoTranslation("", xPos, 49 + 1, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
-  // module_trans = new TGeoTranslation("", xPos,-25, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, -25, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
-  // module_trans = new TGeoTranslation("", xPos, 25, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, 25, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18h_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18h_mcbm.C
deleted file mode 100644
index bfd9b3cf76..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18h_mcbm.C
+++ /dev/null
@@ -1,1081 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18h_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14a";  // do not change
-//
-const TString fileTag      = "tof_v18h";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 130;  // mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 1.0;
-const Float_t Module_Thick_Alu_X_right      = 0.1;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 2.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18h_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  tof_rotation->RotateZ(90);  // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-  module_trans = new TGeoTranslation("", xPos, -49 - 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
-  module_trans = new TGeoTranslation("", xPos, 49 + 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, -25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, 25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18i_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18i_mcbm.C
deleted file mode 100644
index 8c1b80eef3..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18i_mcbm.C
+++ /dev/null
@@ -1,1083 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18h_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14a";  // do not change
-//
-const TString fileTag      = "tof_v18i";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 203;  // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 1.0;
-const Float_t Module_Thick_Alu_X_right      = 0.1;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 2.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18i_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  tof_rotation->RotateZ(90);  // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-  module_trans = new TGeoTranslation("", xPos, -49 - 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
-  module_trans = new TGeoTranslation("", xPos, 49 + 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, -25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, 25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18j_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18j_mcbm.C
deleted file mode 100644
index bf456cb06e..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18j_mcbm.C
+++ /dev/null
@@ -1,1087 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18j_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2018-06-23 - v18j - DE - move 2 RPCs to the front and 3 RPCs to the back inside a TOF module
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v14a";  // do not change
-//
-const TString fileTag      = "tof_v18j";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 203;  // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 4;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 52, 96, 96};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32.};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1.};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 74.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1};
-const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.};
-const Float_t Module_Thick_Alu_X_left       = 1.0;
-const Float_t Module_Thick_Alu_X_right      = 0.1;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 30.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 2.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18j_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  tof_rotation->RotateZ(90);  // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  position_tof_poles(0);
-  position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) {
-      zpos = dzoff *= -1;
-      zpos *= -1;  // flip RPC z pos in module
-    }
-    else {
-      zpos = 0.;
-    }
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-  module_trans = new TGeoTranslation("", xPos, -49 - 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  module_trans = new TGeoTranslation("", xPos, 0, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
-  module_trans = new TGeoTranslation("", xPos, 49 + 1, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, -25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-
-  // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
-  module_trans = new TGeoTranslation("", xPos, 25, zPos + Module_Size_Z[modType]);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-  modNum++;
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18k_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18k_mcbm.C
deleted file mode 100644
index 60b36caafd..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18k_mcbm.C
+++ /dev/null
@@ -1,1148 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18k_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2019-02-19 - v18k - DE - mTOF 2- and 3-stack geoetry as used in December 2018 and March 2019
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v18k_mcbm";  // do not change
-//
-const TString fileTag      = "tof_v18k";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 203;  // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 5;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 10};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1.};
-const Float_t Module_Thick_Alu_X_left       = 1.0;
-const Float_t Module_Thick_Alu_X_right      = 0.1;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-//const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -2.;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18k_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // stand not pointing to target
-  //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Dec2018 setup
-  const Int_t NModules               = 5;
-  xPos                               = 0.;
-  yPos                               = 0.;
-  zPos                               = 400.;
-  const Double_t ModDx[NModules]     = {1.5, 0., -1.5, 49.8, 49.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18l_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18l_mcbm.C
deleted file mode 100644
index 7fbe6eb5fe..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v18l_mcbm.C
+++ /dev/null
@@ -1,1149 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v18l_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2019-03-15 - v18l - DE - resolve overlap of 2 upstream TOF modules from v18k by shifting +x the 2-stack front
-// 2019-02-19 - v18k - DE - mTOF 2- and 3-stack geoetry as used in December 2018 and March 2019
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion = "tof_v18l_mcbm";  // do not change
-//
-const TString fileTag      = "tof_v18l";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front = 203;  // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-const Int_t NumberOfDifferentCounterTypes            = 5;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 10};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1};
-
-const Int_t NofModuleTypes = 6;
-
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1.};
-const Float_t Module_Thick_Alu_X_left       = 1.0;
-const Float_t Module_Thick_Alu_X_right      = 0.1;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 280.;  // move closer to the beam table for March 2019
-//const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] + 3.5 * Module_Size_Z[1] + 4.5 * Module_Size_Z[2];
-//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5;  // corresponds to center of front module in the inner tower
-//const Float_t Wall_Z_Position = 1050;  // corresponds to center of front module in the inner tower
-//
-// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0]
-//                               - 3.5 * Module_Size_Z[1]
-//                               - 4.5 * Module_Size_Z[2]
-//             = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm
-//
-// TOF z back  = Wall_Z_Position + 1.5 * Module_Size_Z[0]
-//             = 1050 + 1.5 * 10 = 1065
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 1000.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -2.;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v18l_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // stand not pointing to target
-  //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Dec2018 setup
-  const Int_t NModules               = 5;
-  xPos                               = 0.;
-  yPos                               = 0.;
-  zPos                               = Wall_Z_Position;
-  const Double_t ModDx[NModules]     = {1.5, 0., -1.5, 51.0, 49.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19a_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19a_mcbm.C
deleted file mode 100644
index 6968223190..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19a_mcbm.C
+++ /dev/null
@@ -1,1324 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v19a_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v19a_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v19a";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 240;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 34.;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 34.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -35.;  //
-const Float_t Buc_Delta_Y_Position     = 0.;    //
-const Float_t Buc_rotate_Z             = 0.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {50.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v19a_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-  TGeoVolume* tofstand         = new TGeoVolumeAssembly(geoVersionStand);
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot      = new TGeoRotation();
-  stand_rot->RotateY(1.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  position_cer_modules(3);
-  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19b_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19b_mcbm.C
deleted file mode 100644
index 4f144eefa7..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19b_mcbm.C
+++ /dev/null
@@ -1,1327 +0,0 @@
-/* Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v19a_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v19b_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v19b";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 240;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 34.;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 34.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -35.;  //
-const Float_t Buc_Delta_Y_Position     = 0.;    //
-const Float_t Buc_rotate_Z             = 0.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {50.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v19b_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Nov 2019 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(1.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  position_cer_modules(3);
-  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19c_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19c_mcbm.C
deleted file mode 100644
index 1d7c5ad924..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19c_mcbm.C
+++ /dev/null
@@ -1,1330 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v19a_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-02-18 - v19c - DE - rotate stacks to 0 degrees
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v19c_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v19c";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 250;  // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front_Stand =  240;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front = 0;  // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 34.;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 34.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -35.;  //
-const Float_t Buc_Delta_Y_Position     = 0.;    //
-const Float_t Buc_rotate_Z             = 0.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {50.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v19c_mcbm()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Nov 2019 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.);  // DEDE
-  //  stand_rot->RotateY(1.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  position_cer_modules(3);
-  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19d_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19d_mcbm.C
deleted file mode 100644
index 8e556b2cf5..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19d_mcbm.C
+++ /dev/null
@@ -1,1310 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v19d_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-02 - v19d - FU - this TOF March 2019 geometry is also known as
-//                          v19a but with a different geometry file format
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v19d_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v19d";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 240;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 34.;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 34.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -35.;  //
-const Float_t Buc_Delta_Y_Position     = 0.;    //
-const Float_t Buc_rotate_Z             = 0.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {50.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v19d_mcbm()
-{
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand         = new TGeoVolumeAssembly(geoVersionStand);
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot      = new TGeoRotation();
-  stand_rot->RotateY(1.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  position_cer_modules(3);
-  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* outfile2 = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19e_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19e_mcbm.C
deleted file mode 100644
index 02fe8634aa..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v19e_mcbm.C
+++ /dev/null
@@ -1,1312 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v19e_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-02 - v19d - FU - this TOF geometry v19e is also known as but with a different geometry file format
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v19e_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v19e";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 240;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 34.;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 34.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -35.;  //
-const Float_t Buc_Delta_Y_Position     = 0.;    //
-const Float_t Buc_rotate_Z             = 0.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {50.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v19e_mcbm()
-{
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Nov 2019 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(1.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  position_cer_modules(3);
-  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* outfile1 = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  outfile1->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_cosmicHD.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_cosmicHD.C
deleted file mode 100644
index b964f219d9..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_cosmicHD.C
+++ /dev/null
@@ -1,1365 +0,0 @@
-/* Copyright (C) 2020 PI-UHd, GSI
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Norbert Herrmann [committer] */
-
-///
-/// \file derived from Create_TOF_Geometry_v18m_mCbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20a";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-
-//
-const TString fileTag      = "tof_v20a";
-const TString FileNameSim  = fileTag + "_cosmicHD.root";
-const TString FileNameGeo  = fileTag + "_cosmicHD.geo.root";
-const TString FileNameInfo = fileTag + "_cosmicHD.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 30;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 30;
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 0 mCBM module
-// 1 STAR module
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 102.15, 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 48.3, 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11., 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11.1, 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 3, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60., -27.74, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30., 30.5, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 10.0, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 0.;
-const Float_t Star2_Delta_Z_Position[3]    = {0., 25., 35.};
-const Float_t Star2_First_Y_Position       = 0.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;  //
-const Float_t Star2_rotate_Z               = 0.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {3.};  //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {0.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 48.4;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = 0.;  //
-const Float_t Buc_Delta_Y_Position     = 0.;  //
-const Float_t Buc_rotate_Z             = 180.;
-const Float_t Buc_rotate_X             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {1.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 15.),
-                                            (float) (TOF_Z_Front + 15.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 0., 0.};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 0., 0.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 35.;  // 20 gap
-const Float_t CERN_First_Y_Position    = 0.;
-const Float_t CERN_X_Offset            = 3.2;  //65.5;
-const Float_t CERN_rotate_Z            = -90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-const Float_t Star_First_Z_Position       = TOF_Z_Front - 12.;
-const Float_t Star_Delta_Z_Position       = 0;   //20.;
-const Float_t Star_First_Y_Position       = 0.;  //
-const Float_t Star_Delta_Y_Position       = 0.;  //
-const Float_t Star_rotate_Y               = 0;   //-6.8;
-const Float_t Star_rotate_Z               = 0.;
-const Int_t Star_NTypes                   = 1;
-const Float_t Star_Types[Star2_NTypes]    = {1.};
-const Float_t Star_Number[Star2_NTypes]   = {1.};
-const Float_t Star_X_Offset[Star2_NTypes] = {-5.};
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Star(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20a_cosmicHD()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-  TGeoVolume* tofstand         = new TGeoVolumeAssembly(geoVersionStand);
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot      = new TGeoRotation();
-  stand_rot->RotateY(0.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  //  position_inner_tof_modules(3);
-  //  position_Dia(1);
-  position_Star2(1);
-  //position_cer_modules(3);
-  // position_CERN(1);
-  position_Buc(1);
-  //position_Star(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  TFile* outfile1 = new TFile(FileNameSim, "RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position[modNum];
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation("Buc2018", Buc_rotate_Z, Buc_rotate_X, 0.);
-  //TGeoRotation* module_rot = new TGeoRotation();
-  // module_rot->RotateZ(Buc_rotate_Z);
-  // module_rot->RotateX(Buc_rotate_X);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  // TGeoRotation* module_rot = new TGeoRotation("Star",Star_rotate_Z,Star_rotate_Y,0.);
-  TGeoRotation* module_rot = new TGeoRotation("Star");
-  module_rot->RotateY(Star_rotate_Y);
-  // module_rot->RotateZ(Star_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star_First_Y_Position;
-  Float_t zPos = Star_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star_Types[j];
-    Float_t xPos  = Star_X_Offset[j];
-    for (Int_t i = 0; i < Star_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star_Delta_Y_Position;
-      zPos += Star_Delta_Z_Position;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C
deleted file mode 100644
index 06735329e8..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C
+++ /dev/null
@@ -1,1334 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v20a_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20a_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v20a";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.2;  // = z=298 mCBM@SIS18
-const Float_t TOF_X_Front_Stand = 0.;     // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0.;     // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2 USTC
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 2};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.1, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {29.3, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., -1.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 1.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 34.;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 30.35;  //
-const Float_t Star2_Delta_Y_Position       = 0.;     //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {49.};  //{51.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20a_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans_local = new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.);
-  TGeoTranslation* stand_trans       = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoCombiTrans* stand_combi_trans  = new TGeoCombiTrans(*stand_trans, *tof_rotation);
-
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("",  0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.55);
-  //stand_rot->RotateY(1.0);
-  TGeoCombiTrans* stand_combi_trans_local = new TGeoCombiTrans(*stand_trans_local, *stand_rot);
-
-  //tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1, stand_combi_trans_local);
-  //tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 0., 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_cosmicHD.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_cosmicHD.C
deleted file mode 100644
index 73ab26baae..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_cosmicHD.C
+++ /dev/null
@@ -1,1371 +0,0 @@
-/* Copyright (C) 2020 PI-UHd, GSI
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Norbert Herrmann [committer] */
-
-///
-/// \file derived from Create_TOF_Geometry_v18m_mCbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-// Aug.10,2020 HD setup with 2 Buc modules
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20b";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-
-//
-const TString fileTag      = "tof_v20b";
-const TString FileNameSim  = fileTag + "_cosmicHD.geo.root";
-const TString FileNameGeo  = fileTag + "_cosmicHD_geo.root";
-const TString FileNameInfo = fileTag + "_cosmicHD.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 30;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 30;
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 80, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 0 mCBM module
-// 1 STAR module
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 102.15, 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 48.3, 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11., 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11.1, 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 3, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60., -27.74, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30., 30.5, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 4., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -1.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 10.0, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 0.;
-const Float_t Star2_Delta_Z_Position[3]    = {0., 22.3, 37.8};
-const Float_t Star2_First_Y_Position       = 0.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;  //
-const Float_t Star2_rotate_Z               = 0.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {3.};  //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {0.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 46.3;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -7.5.;  //
-const Float_t Buc_Delta_Y_Position     = 12.;    //
-const Float_t Buc_rotate_Z             = 180.;
-const Float_t Buc_rotate_X             = 180.;
-const Int_t Buc_NTypes                 = 2;
-const Float_t Buc_Types[Buc_NTypes]    = {6., 6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1., 1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {1., 1.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 15.),
-                                            (float) (TOF_Z_Front + 15.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 0., 0.};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 0., 0.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 35.;  // 20 gap
-const Float_t CERN_First_Y_Position    = 0.;
-const Float_t CERN_X_Offset            = 3.2;  //65.5;
-const Float_t CERN_rotate_Z            = -90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-const Float_t Star_First_Z_Position       = TOF_Z_Front - 12.;
-const Float_t Star_Delta_Z_Position       = 0;   //20.;
-const Float_t Star_First_Y_Position       = 0.;  //
-const Float_t Star_Delta_Y_Position       = 0.;  //
-const Float_t Star_rotate_Y               = 0;   //-6.8;
-const Float_t Star_rotate_Z               = 0.;
-const Int_t Star_NTypes                   = 1;
-const Float_t Star_Types[Star2_NTypes]    = {1.};
-const Float_t Star_Number[Star2_NTypes]   = {1.};
-const Float_t Star_X_Offset[Star2_NTypes] = {-5.};
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Star(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20b_cosmicHD()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-  TGeoVolume* tofstand         = new TGeoVolumeAssembly(geoVersionStand);
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot      = new TGeoRotation();
-  stand_rot->RotateY(0.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  //  position_inner_tof_modules(3);
-  //  position_Dia(1);
-  position_Star2(1);
-  //position_cer_modules(3);
-  // position_CERN(1);
-  position_Buc(2);
-  //position_Star(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-  */
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position[modNum];
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation("Buc2018", Buc_rotate_Z, Buc_rotate_X, 0.);
-  //TGeoRotation* module_rot = new TGeoRotation();
-  // module_rot->RotateZ(Buc_rotate_Z);
-  // module_rot->RotateX(Buc_rotate_X);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  // TGeoRotation* module_rot = new TGeoRotation("Star",Star_rotate_Z,Star_rotate_Y,0.);
-  TGeoRotation* module_rot = new TGeoRotation("Star");
-  module_rot->RotateY(Star_rotate_Y);
-  // module_rot->RotateZ(Star_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star_First_Y_Position;
-  Float_t zPos = Star_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star_Types[j];
-    Float_t xPos  = Star_X_Offset[j];
-    for (Int_t i = 0; i < Star_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star_Delta_Y_Position;
-      zPos += Star_Delta_Z_Position;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C
deleted file mode 100644
index b3b380b7e7..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C
+++ /dev/null
@@ -1,1347 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v20b_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20b_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v20b";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.2;  // = z=298 mCBM@SIS18
-const Float_t TOF_X_Front_Stand = -1.6;   // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;      // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-58.5, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {29.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., -1.25};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 1.3};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 16.5;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 30.35;  //
-const Float_t Star2_Delta_Y_Position       = 0.;     //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {49.};  //{51.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20b_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", TOF_X_Front_Stand, 0., TOF_Z_Front_Stand);
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("",  0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(-2.9);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-  //tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  //tof->RemoveNode((TGeoNode*)tofstand);
-  //top->AddNode(tof, 1, tof_rotation);
-  //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans);
-  /*
-  CbmTransport run;
-  run.SetGeoFileName(FileNameGeo);
-  run.LoadSetup("setup_mcbm_tof_2020");
-  run.SetField(new CbmFieldConst());
-*/
-  //top->Export(FileNameGeo);
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 0., 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 2., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 34.};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20c_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20c_mcbm.C
deleted file mode 100644
index 0ad8b3a15b..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20c_mcbm.C
+++ /dev/null
@@ -1,1335 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v20b_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20c_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v20c";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 250.;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;     // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 16.5;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 3.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20c_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.0);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  //  tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  // position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  // position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {-50., 0., 50., -25., 25.0};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 0, 0, 16.5, 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_cosmicHD.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_cosmicHD.C
deleted file mode 100644
index 0052d64081..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_cosmicHD.C
+++ /dev/null
@@ -1,1382 +0,0 @@
-/* Copyright (C) 2020 PI-UHd, GSI
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Norbert Herrmann [committer] */
-
-///
-/// \file derived from Create_TOF_Geometry_v18m_mCbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-// Aug.10,2020 HD setup with 2 Buc modules
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20d";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-
-//
-const TString fileTag      = "tof_v20d";
-const TString FileNameSim  = fileTag + "_cosmicHD.geo.root";
-const TString FileNameGeo  = fileTag + "_cosmicHD_geo.root";
-const TString FileNameInfo = fileTag + "_cosmicHD.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 30;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 30;
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2 USTC
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 0 mCBM module TSHU
-// 1 STAR module  TSHU
-// 2 mCBM module USTC
-// 3 STAR module USTC
-// 4 Star2 USTC
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2 TSHU
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 102.15, 180., 180., 100., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 48.3, 74., 28., 49., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11., 11., 4.5, 0., 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11.1, 13., 11., 11.2, 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 2, 5, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 3, 3, 5, 2, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60., -27.74, -56.0, -60.0, 0.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30., 30.5, 51.0, 30.0, 0., 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 4., 0., 4., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, -1.5, 0., -3., 0., 0.0, -1.5};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 10.0, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 0.;
-const Float_t Star2_Delta_Z_Position[3]    = {0., 22.3, 37.8};
-const Float_t Star2_First_Y_Position       = 0.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;  //
-const Float_t Star2_rotate_Z               = 0.;
-const Int_t Star2_NTypes                   = 2;
-const Float_t Star2_Types[Star2_NTypes]    = {9., 4.};
-const Float_t Star2_Number[Star2_NTypes]   = {1., 2.};  //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {0., 0.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 46.3;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = 7.9;   // 7.5
-const Float_t Buc_Delta_Y_Position     = -15.;  //
-const Float_t Buc_rotate_Z             = 180.;
-const Float_t Buc_rotate_X             = 180.;
-const Int_t Buc_NTypes                 = 2;
-const Float_t Buc_Types[Buc_NTypes]    = {6., 6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1., 1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {1., 1.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 15.),
-                                            (float) (TOF_Z_Front + 15.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 0., 0.};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 0., 0.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 35.;  // 20 gap
-const Float_t CERN_First_Y_Position    = 0.;
-const Float_t CERN_X_Offset            = 3.2;  //65.5;
-const Float_t CERN_rotate_Z            = -90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-const Float_t Star_First_Z_Position       = TOF_Z_Front - 12.;
-const Float_t Star_Delta_Z_Position       = 0;   //20.;
-const Float_t Star_First_Y_Position       = 0.;  //
-const Float_t Star_Delta_Y_Position       = 0.;  //
-const Float_t Star_rotate_Y               = 0;   //-6.8;
-const Float_t Star_rotate_Z               = 0.;
-const Int_t Star_NTypes                   = 1;
-const Float_t Star_Types[Star2_NTypes]    = {1.};
-const Float_t Star_Number[Star2_NTypes]   = {1.};
-const Float_t Star_X_Offset[Star2_NTypes] = {-5.};
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Star(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20d_cosmicHD()
-{
-  // Load the necessary FairRoot libraries
-  //  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
-  //  basiclibs();
-  //  gSystem->Load("libGeoBase");
-  //  gSystem->Load("libParBase");
-  //  gSystem->Load("libBase");
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(tof, 1, tof_rotation);
-
-  TGeoVolume* tofstand         = new TGeoVolumeAssembly(geoVersionStand);
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot      = new TGeoRotation();
-  stand_rot->RotateY(0.);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  //  position_inner_tof_modules(3);
-  //  position_Dia(1);
-  position_Star2(2);
-  //position_cer_modules(3);
-  // position_CERN(1);
-  position_Buc(2);
-  position_Star(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-  */
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kCyan);  // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    if (modType == 6) counter_rot->RotateX(180);
-
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 1.5, 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 16.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    modNum        = 0;
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position[modNum];
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation("Buc2018", Buc_rotate_Z, Buc_rotate_X, 0.);
-
-  TGeoRotation* module_rot0 = new TGeoRotation("Buc2018", Buc_rotate_Z, 0, 0.);
-  //TGeoRotation* module_rot = new TGeoRotation();
-  // module_rot->RotateZ(Buc_rotate_Z);
-  // module_rot->RotateX(Buc_rotate_X);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      if (j == 0) module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      else
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  // TGeoRotation* module_rot = new TGeoRotation("Star",Star_rotate_Z,Star_rotate_Y,0.);
-  TGeoRotation* module_rot = new TGeoRotation("Star");
-  module_rot->RotateY(Star_rotate_Y);
-  // module_rot->RotateZ(Star_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star_First_Y_Position;
-  Float_t zPos = Star_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star_Types[j];
-    Float_t xPos  = Star_X_Offset[j];
-    for (Int_t i = 0; i < Star_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star_Delta_Y_Position;
-      zPos += Star_Delta_Z_Position;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_mcbm.C
deleted file mode 100644
index 6905dfe39d..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20d_mcbm.C
+++ /dev/null
@@ -1,1338 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v20b_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20d_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v20d";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 250.;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;     // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 34.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 11., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 5, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -60.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 30.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 10.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 16.5;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 3.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20d_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.0);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  //  tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  // position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  // position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 8;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {-50., 0., 50., -25., 25.0, -37.5, 37.5, 0.0};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 0, 0, 16.5, 16.5, 33., 33., 49.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0, -90.0, -90.0, -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    if (iMod < 5) { gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[0], modNum, module_combi_trans); }
-    else {
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[2], modNum, module_combi_trans);
-    }
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20e_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20e_mcbm.C
deleted file mode 100644
index 5fe88fcaa9..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20e_mcbm.C
+++ /dev/null
@@ -1,1363 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v20e_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-07-28 - v20e - DE - based on v18b, rotate by -3.76 degrees around Y to point to target
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20e_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v20e";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.2;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;      // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 16.5;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20e_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  //  stand_rot->RotateY(-2.7);
-  //
-  // correct for pointing to target position as reported by Ekata Nandy on 28.07.2020
-  // tan(45*acos(-1)/180)
-  // (double) 1.0000000
-  //
-  // atan(tan(45*acos(-1)/180))/acos(-1)*180
-  // (double) 45.000000
-  //
-  // atan(-16.24/247.2)/acos(-1)*180
-  // (double) -3.7586904
-  //
-  // tan(-3.76*acos(-1)/180) * 247.2
-  // (double) -16.245674
-  //
-  stand_rot->RotateY(-3.76);
-  //  stand_rot->RotateY(0);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  tof->AddNode(tofstand, 1, stand_combi_trans);
-  //  tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  //tof->RemoveNode((TGeoNode*)tofstand);
-  //top->AddNode(tof, 1, tof_rotation);
-  //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans);
-  /*
-  CbmTransport run;
-  run.SetGeoFileName(FileNameGeo);
-  run.LoadSetup("setup_mcbm_tof_2020");
-  run.SetField(new CbmFieldConst());
-*/
-  //top->Export(FileNameGeo);
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 0., 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 34.};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C
deleted file mode 100644
index 25dcffc32a..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C
+++ /dev/null
@@ -1,1353 +0,0 @@
-/* Copyright (C) 2020 PI-UHd, GSI
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Norbert Herrmann [committer] */
-
-///
-/// \file Create_TOF_Geometry_v20f_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v20f_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v20f";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.2;  // = z=298 mCBM@SIS18
-const Float_t TOF_X_Front_Stand = 0.;     // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0.;     // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2 USTC
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 2};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.1, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {29.3, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., -1.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 1.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 16.5;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 30.35;  //
-const Float_t Star2_Delta_Y_Position       = 0.;     //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {49.};  //{51.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v20f_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans_local = new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.);
-  TGeoTranslation* stand_trans       = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoCombiTrans* stand_combi_trans  = new TGeoCombiTrans(*stand_trans, *tof_rotation);
-
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("",  0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.55);
-  //stand_rot->RotateY(1.0);
-  TGeoCombiTrans* stand_combi_trans_local = new TGeoCombiTrans(*stand_trans_local, *stand_rot);
-
-  //tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1, stand_combi_trans_local);
-  //tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  //tof->RemoveNode((TGeoNode*)tofstand);
-  //top->AddNode(tof, 1, tof_rotation);
-  //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans);
-  /*
-  CbmTransport run;
-  run.SetGeoFileName(FileNameGeo);
-  run.LoadSetup("setup_mcbm_tof_2020");
-  run.SetField(new CbmFieldConst());
-*/
-  //top->Export(FileNameGeo);
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 0., 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 34.};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C
deleted file mode 100644
index 5726c38515..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C
+++ /dev/null
@@ -1,1354 +0,0 @@
-/* Copyright (C) 2020-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v21a_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v21a_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v21a";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.;  // = z=298 mCBM@SIS18
-const Float_t TOF_X_Front_Stand = 0.;    // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0.;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2 USTC
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 2};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.1, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {29.3, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., -1.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 1.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 15.7;
-const Float_t Star2_Delta_Z_Position       = 16.3;
-const Float_t Star2_First_Y_Position       = 31.35;  //
-const Float_t Star2_Delta_Y_Position       = 0.;     //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 2;
-const Float_t Star2_Types[Star2_NTypes]    = {9., 9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1., 1.};  //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {0., 0.};  //{51.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 16.5;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {0.};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v21a_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans_local = new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.);
-  TGeoTranslation* stand_trans       = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoCombiTrans* stand_combi_trans  = new TGeoCombiTrans(*stand_trans, *tof_rotation);
-
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("",  0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.);
-  //stand_rot->RotateY(1.0);
-  TGeoCombiTrans* stand_combi_trans_local = new TGeoCombiTrans(*stand_trans_local, *stand_rot);
-
-  //tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1, stand_combi_trans_local);
-  //tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(2);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  //tof->RemoveNode((TGeoNode*)tofstand);
-  //top->AddNode(tof, 1, tof_rotation);
-  //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans);
-  /*
-  CbmTransport run;
-  run.SetGeoFileName(FileNameGeo);
-  run.LoadSetup("setup_mcbm_tof_2020");
-  run.SetField(new CbmFieldConst());
-*/
-  //top->Export(FileNameGeo);
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {-50., -50., -50., 0., 0.};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules] = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules] = {0., 16.5, 34., 0., 55.5};  // regular
-  //const Double_t ModDz[NModules]     = {0., 16.5, 34., 55.5, 0.};   // mapping ??
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21b_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21b_mcbm.C
deleted file mode 100644
index f91d936f50..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21b_mcbm.C
+++ /dev/null
@@ -1,1354 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TOF_Geometry_v21b_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2020-07-20 - v21b - NH - test different MRPC types in STAR2 moodule, replace 901 by 700
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v21b_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v21b";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.2;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;      // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-
-const Int_t NCounterInModule[NofModuleTypes]                 = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2};
-const Int_t NCounterMax                                      = 8;
-const Int_t CounterTypeInModule[NofModuleTypes][NCounterMax] = {
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
-  2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6,
-  6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 0, 7, 0, 0, 0, 0, 0, 0};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 16.5;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v21b_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(-2.7);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  //tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  //tof->RemoveNode((TGeoNode*)tofstand);
-  //top->AddNode(tof, 1, tof_rotation);
-  //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans);
-  /*
-  CbmTransport run;
-  run.SetGeoFileName(FileNameGeo);
-  run.LoadSetup("setup_mcbm_tof_2020");
-  run.SetField(new CbmFieldConst());
-*/
-  //top->Export(FileNameGeo);
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume(Form("counter_%d", modType), counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType][0];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType][0];  //TBC
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    cout << "place counter " << j << " of type " << CounterTypeInModule[modType][j] << " in module of type " << modType
-         << " at z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    //gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-    gas_box_vol->AddNode(gCounter[CounterTypeInModule[modType][j]], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum;
-  for (Int_t j = 2; j < modNType; j++) {  // place only M4 type modules (modNType == 2)
-                                          //DEDE
-    modType = Inner_Module_Types[j];
-    modNum  = 0;
-    //  for(Int_t i=0; i<Inner_Module_Number[j]; i++) {
-    //  for(Int_t i=0; i<1; i++) { // place 1x2 modules in the top and same in the bottom
-    for (Int_t i = 0; i < 2; i++) {  // place 2x2 modules in the top and same in the bottom
-      ii++;
-      cout << "Inner ii " << ii << " Last " << Last_Size_Y << ", " << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      //    DeltaY = 1.5;
-      cout << "DeltaY " << DeltaY << endl;
-      yPos += DeltaY;
-      Last_Size_Y = Module_Size_Y[modType];
-      Last_Over_Y = Module_Over_Y[modType];
-      cout << "Position Inner Module " << i << " of " << Inner_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      ///    module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      ///    module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-      ///    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      ///    modNum++;
-      //    //    if (ii>0) {
-      //    if (ii>1) {
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //      module_trans
-      //	= new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]);
-      //      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      //    modNum++;
-      //    }
-    }
-  }
-  // module_trans = new TGeoTranslation("", xPos, -49-3, zPos);
-
-  // Mar2019 setup
-  const Int_t NModules           = 5;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Double_t ModDx[NModules] = {0., 0., 0., 49.8, 49.8};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 34., 0., 34.};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-    modNum++;
-  }
-
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21c_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21c_mcbm.C
deleted file mode 100644
index 308167f5cb..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21c_mcbm.C
+++ /dev/null
@@ -1,1281 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Norbert Herrmann */
-
-///
-/// \file Create_TOF_Geometry_v21a_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2021-06-21 - v21c - NH - double stack with 031 910 BUC 041
-// 2021-05-24 - v21b - NH - add M6 module
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v21c_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v21c";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.;  // = z=298 mCBM@SIS18
-const Float_t TOF_X_Front_Stand = 0.;    // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0.;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2 USTC
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {32.0, 32.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 0 M4 (TSHU)
-// 1 M4 (USTC)
-// 2 M6 (USTC)
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 2};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 5, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.1, -66.0, -66.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {29.3, 32.0, 29.3, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 15.7;
-const Float_t Star2_Delta_Z_Position       = 200;    //16.3;
-const Float_t Star2_First_Y_Position       = 31.35;  //
-const Float_t Star2_Delta_Y_Position       = 0.;     //
-const Int_t Star2_NTypes                   = 2;
-const Float_t Star2_rotate_Z[Star2_NTypes] = {-90., -90.};
-const Float_t Star2_Types[Star2_NTypes]    = {9., 9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1., 1.};  //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {0., 0.};  //{51.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 33.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = 32.;  // -29.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;   //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {0.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-void Create_TOF_Geometry_v21c_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans_local = new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.);
-  TGeoTranslation* stand_trans       = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoCombiTrans* stand_combi_trans  = new TGeoCombiTrans(*stand_trans, *tof_rotation);
-
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("",  0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.);
-  //stand_rot->RotateY(1.0);
-  TGeoCombiTrans* stand_combi_trans_local = new TGeoCombiTrans(*stand_trans_local, *stand_rot);
-
-  //tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1, stand_combi_trans_local);
-  //tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(2);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  //tof->RemoveNode((TGeoNode*)tofstand);
-  //top->AddNode(tof, 1, tof_rotation);
-  //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans);
-  /*
-  CbmTransport run;
-  run.SetGeoFileName(FileNameGeo);
-  run.LoadSetup("setup_mcbm_tof_2020");
-  run.SetField(new CbmFieldConst());
-*/
-  //top->Export(FileNameGeo);
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum[4] = {4 * 0};
-
-  // May2021 setup
-  const Int_t NModules           = 6;
-  Double_t xPos                  = 0.;
-  Double_t yPos                  = 0.;
-  Double_t zPos                  = TOF_Z_Front;
-  const Int_t ModType[NModules]  = {0, 0, 0, 0, 0, 2};
-  const Double_t ModDx[NModules] = {-53.5, -57.3, -66.8, 0., 0., -64.};
-  //const Double_t ModDx[NModules] = { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0., -6.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 59., 0., 59.5, 34.};  // regular
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0, -90.};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[ModType[iMod]], modNum[ModType[iMod]], module_combi_trans);
-    cout << "Placed Module " << modNum[ModType[iMod]] << ", Type " << ModType[iMod] << endl;
-    modNum[ModType[iMod]]++;
-  }
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans      = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-  TGeoRotation* module_rot           = NULL;
-  Float_t yPos                       = Star2_First_Y_Position;
-  Float_t zPos                       = Star2_First_Z_Position;
-  Int_t ii                           = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    module_rot    = new TGeoRotation();
-    module_rot->RotateZ(Star2_rotate_Z[j]);
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21d_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21d_mcbm.C
deleted file mode 100644
index fd65c86659..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21d_mcbm.C
+++ /dev/null
@@ -1,1282 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Norbert Herrmann */
-
-///
-/// \file Create_TOF_Geometry_v21d_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-//
-// 2021-09-28 - v21d - SR - based on v21c the position is corrected
-// 2021-06-21 - v21c - NH - double stack with 031 910 BUC 041
-// 2021-05-24 - v21b - NH - add M6 module
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v21d_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v21d";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 247.;  // = z=298 mCBM@SIS18
-const Float_t TOF_X_Front_Stand = 0.;    // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0.;    // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2 USTC
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {32.0, 32.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 0 M4 (TSHU)
-// 1 M4 (USTC)
-// 2 M6 (USTC)
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 2};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 5, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.1, -66.0, -66.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {29.3, 32.0, 29.3, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 15.7;
-const Float_t Star2_Delta_Z_Position       = 200;    //16.3;
-const Float_t Star2_First_Y_Position       = 31.35;  //
-const Float_t Star2_Delta_Y_Position       = 0.;     //
-const Int_t Star2_NTypes                   = 2;
-const Float_t Star2_rotate_Z[Star2_NTypes] = {-90., -90.};
-const Float_t Star2_Types[Star2_NTypes]    = {9., 9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1., 1.};  //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {0., 0.};  //{51.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 33.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = 32.;  // -29.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;   //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {0.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.2 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 0.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-void Create_TOF_Geometry_v21d_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans_local = new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.);
-  TGeoTranslation* stand_trans       = new TGeoTranslation("", 53., 0., TOF_Z_Front_Stand);
-  TGeoCombiTrans* stand_combi_trans  = new TGeoCombiTrans(*stand_trans, *tof_rotation);
-
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("",  0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(12.5);
-  //stand_rot->RotateY(1.0);
-  TGeoCombiTrans* stand_combi_trans_local = new TGeoCombiTrans(*stand_trans_local, *stand_rot);
-
-  //tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1, stand_combi_trans_local);
-  //tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  position_Star2(2);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  //tof->RemoveNode((TGeoNode*)tofstand);
-  //top->AddNode(tof, 1, tof_rotation);
-  //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans);
-  /*
-  CbmTransport run;
-  run.SetGeoFileName(FileNameGeo);
-  run.LoadSetup("setup_mcbm_tof_2020");
-  run.SetField(new CbmFieldConst());
-*/
-  //top->Export(FileNameGeo);
-
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  // for (Int_t j=0; j<modNType; j++){
-  // for (Int_t j=1; j<modNType; j++){
-  Int_t modType;
-  Int_t modNum[4] = {4 * 0};
-
-  // May2021 setup
-  const Int_t NModules           = 6;
-  Double_t xPos                  = 0.;
-  Double_t yPos                  = 0.;
-  Double_t zPos                  = TOF_Z_Front;
-  const Int_t ModType[NModules]  = {0, 0, 0, 0, 0, 2};
-  const Double_t ModDx[NModules] = {-53.5, -57.3, -66.8, 0., 0., -64.};
-  //const Double_t ModDx[NModules] = { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0., -6.};
-  const Double_t ModDz[NModules]     = {0., 16.5, 59., 0., 59.5, 34.};  // regular
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0, -90.};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[ModType[iMod]], modNum[ModType[iMod]], module_combi_trans);
-    cout << "Placed Module " << modNum[ModType[iMod]] << ", Type " << ModType[iMod] << endl;
-    modNum[ModType[iMod]]++;
-  }
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans      = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-  TGeoRotation* module_rot           = NULL;
-  Float_t yPos                       = Star2_First_Y_Position;
-  Float_t zPos                       = Star2_First_Z_Position;
-  Int_t ii                           = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    module_rot    = new TGeoRotation();
-    module_rot->RotateZ(Star2_rotate_Z[j]);
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v22a_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v22a_mcbm.C
deleted file mode 100644
index 083304f861..0000000000
--- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v22a_mcbm.C
+++ /dev/null
@@ -1,1308 +0,0 @@
-/* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig, Shreya Roy [committer] */
-
-///
-/// \file Create_TOF_Geometry_v22a_mcbm.C
-/// \brief Generates TOF geometry in Root format.
-///
-
-// Changelog
-// 2021-11-17 - v22a - QZ - Modified v20d to fit the logic of digibdf.par
-// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy
-// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run
-// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run
-// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m
-// 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS
-// 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave
-// 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back
-// 2017-07-14 - v18f - DE - reduce vertical gap between TOF modules to fix the gap between modules 1-2 and 4-5
-// 2017-05-17 - v18e - DE - rotate electronics away from beam, shift 16 cm away from beam along x-axis
-// 2017-05-17 - v18d - DE - change geometry name to v18d
-
-// in root all sizes are given in cm
-
-#include "TFile.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoVolume.h"
-#include "TList.h"
-#include "TMath.h"
-#include "TROOT.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of geometry version and output file
-const TString geoVersion      = "tof_v22a_mcbm";  // do not change
-const TString geoVersionStand = geoVersion + "Stand";
-//
-const TString fileTag      = "tof_v22a";
-const TString FileNameSim  = fileTag + "_mcbm.geo.root";
-const TString FileNameGeo  = fileTag + "_mcbm_geo.root";
-const TString FileNameInfo = fileTag + "_mcbm.geo.info";
-
-// TOF_Z_Front corresponds to front cover of outer super module towers
-const Float_t TOF_Z_Front_Stand = 250.;  // = z=298 mCBM@SIS18
-const Float_t TOF_Z_Front       = 0;     // = z=298 mCBM@SIS18
-//const Float_t TOF_Z_Front =  130;  // = z=225 mCBM@SIS18
-//const Float_t TOF_Z_Front =  250;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  450;  // SIS 100 hadron
-//const Float_t TOF_Z_Front =  600;  // SIS 100 electron
-//const Float_t TOF_Z_Front =  650;  // SIS 100 muon
-//const Float_t TOF_Z_Front =  880;  // SIS 300 electron
-//const Float_t TOF_Z_Front = 1020;  // SIS 300 muon
-//
-//const Float_t TOF_Z_Front = 951.5;   // Wall_Z_Position = 1050 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium = "air";
-const TString BoxVolumeMedium     = "aluminium";
-const TString NoActivGasMedium    = "RPCgas_noact";
-const TString ActivGasMedium      = "RPCgas";
-const TString GlasMedium          = "RPCglass";
-const TString ElectronicsMedium   = "carbon";
-
-// Counters:
-// 0 MRPC3a
-// 1 MRPC3b
-// 2
-// 3
-// 4 Diamond
-//
-// 6 Buc 2019
-// 7 CERN 20gap
-// 8 Ceramic Pad
-const Int_t NumberOfDifferentCounterTypes            = 9;
-const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1};
-
-const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 32., 32., 32., 0.2, 32., 28.8, 20., 2.4};
-const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10., 0.2, 10., 6., 20., 2.4};
-const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025};
-
-const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8, 1, 8, 10, 20, 4};
-//const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, 32, 32, 32, 8, 32, 32, 20, 1};
-//const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb
-
-const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = {-0.6, -0.6, -0.6, -0.6, -0.1,
-                                                                           -0.6, -0.6, -0.6, -1.};
-
-const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, 34.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1};
-const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1};
-const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1};
-
-const Int_t NofModuleTypes = 10;
-// 5 Diamond
-// 6 Buc
-// 7 CERN 20 gap
-// 8 Ceramic
-// 9 Star2
-// Aluminum box for all module types
-const Float_t Module_Size_X[NofModuleTypes] = {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.};
-const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.};
-const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.};
-const Float_t Module_Size_Z[NofModuleTypes] = {11., 11., 11., 11., 11., 1., 12., 6., 6.2, 11.2};
-const Float_t Module_Thick_Alu_X_left       = 0.1;
-const Float_t Module_Thick_Alu_X_right      = 1.0;
-const Float_t Module_Thick_Alu_Y            = 0.1;
-const Float_t Module_Thick_Alu_Z            = 0.1;
-
-// Distance to the center of the TOF wall [cm];
-const Float_t Wall_Z_Position = 400.;
-const Float_t MeanTheta       = 0.;
-
-//Type of Counter for module
-const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 4, 6, 7, 8, 0};
-const Int_t NCounterInModule[NofModuleTypes]    = {5, 5, 5, 5, 5, 1, 2, 1, 8, 2};
-
-// Placement of the counter inside the module
-const Float_t CounterXStartPosition[NofModuleTypes] = {-60.0, -66.0, -60.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.};
-const Float_t CounterXDistance[NofModuleTypes]      = {30.0, 32.0, 30.0, 30.0, 30.0, 0.0, 0., 0., 2., 0.};
-const Float_t CounterYStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.};
-const Float_t CounterYDistance[NofModuleTypes]      = {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 0.};
-const Float_t CounterZDistance[NofModuleTypes]      = {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.};
-const Float_t CounterZStartPosition[NofModuleTypes] = {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.};
-const Float_t CounterRotationAngle[NofModuleTypes]  = {0., 8.7, 10.0, 0., 0., 0., 0., 0., 0., 0.};
-
-// Pole (support structure)
-const Int_t MaxNumberOfPoles = 20;
-Float_t Pole_ZPos[MaxNumberOfPoles];
-Float_t Pole_Col[MaxNumberOfPoles];
-Int_t NumberOfPoles = 0;
-
-const Float_t Pole_Size_X  = 20.;
-const Float_t Pole_Size_Y  = 300.;
-const Float_t Pole_Size_Z  = 10.;
-const Float_t Pole_Thick_X = 5.;
-const Float_t Pole_Thick_Y = 5.;
-const Float_t Pole_Thick_Z = 5.;
-
-// Bars (support structure)
-const Float_t Bar_Size_X = 20.;
-const Float_t Bar_Size_Y = 20.;
-Float_t Bar_Size_Z       = 100.;
-
-const Int_t MaxNumberOfBars = 20;
-Float_t Bar_ZPos[MaxNumberOfBars];
-Float_t Bar_XPos[MaxNumberOfBars];
-Int_t NumberOfBars = 0;
-
-const Float_t ChamberOverlap = 40;
-const Float_t DxColl         = 158.0;  //Module_Size_X-ChamberOverlap;
-//const Float_t Pole_Offset=Module_Size_X/2.+Pole_Size_X/2.;
-const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.;
-
-// Position for module placement
-const Float_t Inner_Module_First_Y_Position = 16.;
-const Float_t Inner_Module_Last_Y_Position  = 480.;
-const Float_t Inner_Module_X_Offset         = 0.;  // centered position in x/y
-//const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x
-const Int_t Inner_Module_NTypes                       = 3;
-const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.};
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2.,2.,6.}; //V13_3a
-const Float_t Inner_Module_Number[Inner_Module_NTypes] = {2., 2., 1.};  //V13_3a
-//const Float_t Inner_Module_Number[Inner_Module_NTypes] = {0.,0.,0.}; //debugging
-
-const Float_t InnerSide_Module_X_Offset                    = 51.;
-const Float_t InnerSide_Module_NTypes                      = 1;
-const Float_t InnerSide_Module_Types[Inner_Module_NTypes]  = {5.};
-const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {2.};  //v13_3a
-//const Float_t InnerSide_Module_Number[Inner_Module_NTypes] = {0.};  //debug
-
-const Float_t Outer_Module_First_Y_Position                              = 0.;
-const Float_t Outer_Module_Last_Y_Position                               = 480.;
-const Float_t Outer_Module_X_Offset                                      = 3.;
-const Int_t Outer_Module_Col                                             = 4;
-const Int_t Outer_Module_NTypes                                          = 2;
-const Float_t Outer_Module_Types[Outer_Module_NTypes][Outer_Module_Col]  = {1., 1., 1., 1., 2., 2., 2., 2.};
-const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.};  //V13_3a
-//const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0.,  0.,0.,0.,0.};//debug
-
-const Float_t Star2_First_Z_Position       = TOF_Z_Front + 16.5;
-const Float_t Star2_Delta_Z_Position       = 0.;
-const Float_t Star2_First_Y_Position       = 32.;  //
-const Float_t Star2_Delta_Y_Position       = 0.;   //
-const Float_t Star2_rotate_Z               = -90.;
-const Int_t Star2_NTypes                   = 1;
-const Float_t Star2_Types[Star2_NTypes]    = {9.};
-const Float_t Star2_Number[Star2_NTypes]   = {1.};   //debugging, V16b
-const Float_t Star2_X_Offset[Star2_NTypes] = {51.};  //{62.};
-
-const Float_t Buc_First_Z_Position     = TOF_Z_Front + 50.;
-const Float_t Buc_Delta_Z_Position     = 0.;
-const Float_t Buc_First_Y_Position     = -32.5;  //
-const Float_t Buc_Delta_Y_Position     = 0.;     //
-const Float_t Buc_rotate_Z             = 180.;
-const Int_t Buc_NTypes                 = 1;
-const Float_t Buc_Types[Buc_NTypes]    = {6.};
-const Float_t Buc_Number[Buc_NTypes]   = {1.};  //debugging, V16b
-const Float_t Buc_X_Offset[Buc_NTypes] = {53.5};
-
-const Int_t Cer_NTypes                   = 3;
-const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), (float) (TOF_Z_Front + 45.),
-                                            (float) (TOF_Z_Front + 45.)};
-const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8};
-const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.};
-const Float_t Cer_rotate_Z[Cer_NTypes]   = {0., 0., 0.};
-const Float_t Cer_Types[Cer_NTypes]      = {5., 8., 8.};
-const Float_t Cer_Number[Cer_NTypes]     = {1., 1., 1.};  //V16b
-
-const Float_t CERN_Z_Position          = TOF_Z_Front + 50;  // 20 gap
-const Float_t CERN_First_Y_Position    = 36.;
-const Float_t CERN_X_Offset            = 46.;  //65.5;
-const Float_t CERN_rotate_Z            = 90.;
-const Int_t CERN_NTypes                = 1;
-const Float_t CERN_Types[CERN_NTypes]  = {7.};  // this is the SmType!
-const Float_t CERN_Number[CERN_NTypes] = {1.};  // evtl. double for split signals
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-TGeoVolume* gCounter[NumberOfDifferentCounterTypes];
-TGeoVolume* gPole;
-TGeoVolume* gBar[MaxNumberOfBars];
-
-const Float_t Dia_Z_Position         = -0.5 - TOF_Z_Front_Stand;
-const Float_t Dia_First_Y_Position   = 0.;
-const Float_t Dia_X_Offset           = 3.;
-const Float_t Dia_rotate_Z           = 0.;
-const Int_t Dia_NTypes               = 1;
-const Float_t Dia_Types[Dia_NTypes]  = {5.};
-const Float_t Dia_Number[Dia_NTypes] = {1.};
-
-Float_t Last_Size_Y = 0.;
-Float_t Last_Over_Y = 0.;
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_counter(Int_t);
-TGeoVolume* create_new_counter(Int_t);
-TGeoVolume* create_tof_module(Int_t);
-TGeoVolume* create_new_tof_module(Int_t);
-TGeoVolume* create_tof_pole();
-TGeoVolume* create_tof_bar();
-void position_tof_poles(Int_t);
-void position_tof_bars(Int_t);
-void position_inner_tof_modules(Int_t);
-void position_side_tof_modules(Int_t);
-void position_outer_tof_modules(Int_t);
-void position_Dia(Int_t);
-void position_Star2(Int_t);
-void position_Buc(Int_t);
-void position_cer_modules(Int_t);
-void position_CERN(Int_t);
-void dump_info_file();
-
-
-void Create_TOF_Geometry_v22a_mcbm()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(5);  // 2 = super modules
-  gGeoMan->SetVisOption(0);
-
-  // Create the top volume
-  /*
-  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
-  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-  */
-
-  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
-  gGeoMan->SetTopVolume(top);
-
-  TGeoRotation* tof_rotation = new TGeoRotation();
-  tof_rotation->RotateY(0.);  // angle with respect to beam axis
-    //tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(   0 );   // electronics on  9 o'clock position = +x
-  //  tof_rotation->RotateZ(  90 );   // electronics on 12 o'clock position (top)
-  //  tof_rotation->RotateZ( 180 );   // electronics on  3 o'clock position = -x
-  //  tof_rotation->RotateZ( 270 );   // electronics on  6 o'clock position (bottom)
-
-  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
-  //  top->AddNode(tof, 1, tof_rotation);
-  top->AddNode(tof, 1);
-
-  TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand);
-  // Mar 2020 run
-  TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  // Nov 2019 run
-  // TGeoTranslation*  stand_trans   = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand);
-  //  TGeoTranslation*  stand_trans   = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand);
-  TGeoRotation* stand_rot = new TGeoRotation();
-  stand_rot->RotateY(0.0);
-  TGeoCombiTrans* stand_combi_trans = new TGeoCombiTrans(*stand_trans, *stand_rot);
-  //  tof->AddNode(tofstand, 1, stand_combi_trans);
-  tof->AddNode(tofstand, 1);
-
-  for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) {
-    gCounter[counterType] = create_new_counter(counterType);
-  }
-
-  for (Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) {
-    gModules[moduleType] = create_new_tof_module(moduleType);
-    gModules[moduleType]->SetVisContainers(1);
-  }
-
-  // no pole
-  //  gPole = create_tof_pole();
-
-  //  position_side_tof_modules(1);  // keep order !!
-  //  position_inner_tof_modules(2);
-  position_inner_tof_modules(3);
-  position_Dia(1);
-  // position_Star2(1);
-  //  position_cer_modules(3);
-  //  position_CERN(1);
-  // position_Buc(1);
-
-  cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0]
-       << ", col=1:  " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl;
-  cout << "Outer Number " << Outer_Module_Number[0][0] << ", " << Outer_Module_Number[1][0]
-       << ", col=1:  " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl;
-  //  position_outer_tof_modules(4);
-  // position_tof_poles(0);
-  // position_tof_bars(0);
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->CheckOverlaps(0.001, "s");
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  tof->Export(FileNameSim);
-  TFile* geoFile = new TFile(FileNameSim, "UPDATE");
-  stand_combi_trans->Write();
-  geoFile->Close();
-
-  /*
-  TFile* outfile1 = new TFile(FileNameSim,"RECREATE");
-  top->Write();
-  //gGeoMan->Write();
-  outfile1->Close();
-*/
-  TFile* outfile2 = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();
-  outfile2->Close();
-
-  dump_info_file();
-
-  top->SetVisContainers(1);
-  gGeoMan->SetVisLevel(5);
-  top->Draw("ogl");
-  //top->Draw();
-  //gModules[0]->Draw("ogl");
-  //  gModules[0]->Draw("");
-  gModules[0]->SetVisContainers(1);
-  //  gModules[1]->Draw("");
-  gModules[1]->SetVisContainers(1);
-  //gModules[5]->Draw("");
-  //  top->Raytrace();
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air          = geoMedia->getMedium("air");
-  FairGeoMedium* aluminium    = geoMedia->getMedium("aluminium");
-  FairGeoMedium* RPCgas       = geoMedia->getMedium("RPCgas");
-  FairGeoMedium* RPCgas_noact = geoMedia->getMedium("RPCgas_noact");
-  FairGeoMedium* RPCglass     = geoMedia->getMedium("RPCglass");
-  FairGeoMedium* carbon       = geoMedia->getMedium("carbon");
-
-  // include check if all media are found
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(aluminium);
-  geoBuild->createMedium(RPCgas);
-  geoBuild->createMedium(RPCgas_noact);
-  geoBuild->createMedium(RPCglass);
-  geoBuild->createMedium(carbon);
-}
-
-TGeoVolume* create_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / float(nstrips);
-
-  //single stack
-  Float_t dzpos     = gdz + ggdz;
-  Float_t startzpos = SingleStackStartPosition_Z[modType];
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = (gdy + 0.1) / 2. + dye / 2.;
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-  // Single glass plate
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., 0.);
-
-  // Single gas gap
-  TGeoBBox* gas_gap = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  //TGeoVolume* gas_gap_vol =
-  //new TGeoVolume("tof_gas_gap", gas_gap, noActiveGasVolMed);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("tof_gas_active", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Strip", 1, nstrips, -ggdx / 2., 0);
-
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(70);  // set transparency for the TOF
-  TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., (gdz + ggdz) / 2.);
-
-
-  // Single subdivided active gas gap
-  /*
-    TGeoBBox* gas_active = new TGeoBBox("", gsdx/2., ggdy/2., ggdz/2.);
-    TGeoVolume* gas_active_vol = 
-    new TGeoVolume("tof_gas_active", gas_active, activeGasVolMed);
-  gas_active_vol->SetLineColor(kBlack); // set line color for the gas gap
-  gas_active_vol->SetTransparency(70); // set transparency for the TOF
-  */
-
-  // Add glass plate, inactive gas gap and active gas gaps to a single stack
-  TGeoVolume* single_stack = new TGeoVolumeAssembly("single_stack");
-  single_stack->AddNode(glass_plate_vol, 0, glass_plate_trans);
-  single_stack->AddNode(gas_gap_vol, 0, gas_gap_trans);
-
-  /*
-  for (Int_t l=0; l<nstrips; l++){
-    TGeoTranslation* gas_active_trans 
-      = new TGeoTranslation("", -ggdx/2+(l+0.5)*gsdx, 0., 0.);
-    gas_gap_vol->AddNode(gas_active_vol, l, gas_active_trans);
-    //    single_stack->AddNode(gas_active_vol, l, gas_active_trans);
-  }
-  */
-
-  // Add 8 single stacks + one glass plate at the e09.750nd to a multi stack
-  TGeoVolume* multi_stack = new TGeoVolumeAssembly("multi_stack");
-  Int_t l;
-  for (l = 0; l < ngaps; l++) {
-    TGeoTranslation* single_stack_trans = new TGeoTranslation("", 0., 0., startzpos + l * dzpos);
-    multi_stack->AddNode(single_stack, l, single_stack_trans);
-  }
-  TGeoTranslation* single_glass_back_trans = new TGeoTranslation("", 0., 0., startzpos + ngaps * dzpos);
-  multi_stack->AddNode(glass_plate_vol, l, single_glass_back_trans);
-
-  // Add electronics above and below the glass stack to build a complete counter
-  TGeoVolume* counter                = new TGeoVolumeAssembly("counter");
-  TGeoTranslation* multi_stack_trans = new TGeoTranslation("", 0., 0., 0.);
-  counter->AddNode(multi_stack, l, multi_stack_trans);
-
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kCyan);  // set line color for the gas gap
-  pcb_vol->SetTransparency(10);  // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-  return counter;
-}
-
-TGeoVolume* create_new_counter(Int_t modType)
-{
-
-  //glass
-  Float_t gdx = Glass_X[modType];
-  Float_t gdy = Glass_Y[modType];
-  Float_t gdz = Glass_Z[modType];
-
-  //gas gap
-  Int_t nstrips = NumberOfReadoutStrips[modType];
-  Int_t ngaps   = NumberOfGaps[modType];
-
-
-  Float_t ggdx = GasGap_X[modType];
-  Float_t ggdy = GasGap_Y[modType];
-  Float_t ggdz = GasGap_Z[modType];
-  Float_t gsdx = ggdx / (Float_t)(nstrips);
-
-  // electronics
-  //pcb dimensions
-  Float_t dxe  = Electronics_X[modType];
-  Float_t dye  = Electronics_Y[modType];
-  Float_t dze  = Electronics_Z[modType];
-  Float_t yele = gdy / 2. + dye / 2.;
-
-  // counter size (calculate from glas, gap and electronics sizes)
-  Float_t cdx = TMath::Max(gdx, ggdx);
-  cdx         = TMath::Max(cdx, dxe) + 0.2;
-  Float_t cdy = TMath::Max(gdy, ggdy) + 2 * dye + 0.2;
-  Float_t cdz = ngaps * ggdz + (ngaps + 1) * gdz + 0.2;  // ngaps * (gdz+ggdz) + gdz + 0.2; // ok
-
-  //calculate thickness and first position in counter of single stack
-  Float_t dzpos         = gdz + ggdz;
-  Float_t startzposglas = -ngaps * (gdz + ggdz) / 2.;  // -cdz/2.+0.1+gdz/2.; // ok  // (-cdz+gdz)/2.; // not ok
-  Float_t startzposgas  = startzposglas + gdz / 2. + ggdz / 2.;  // -cdz/2.+0.1+gdz   +ggdz/2.;  // ok
-
-
-  // needed materials
-  TGeoMedium* glassPlateVolMed  = gGeoMan->GetMedium(GlasMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-  TGeoMedium* activeGasVolMed   = gGeoMan->GetMedium(ActivGasMedium);
-  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsMedium);
-
-
-  // define counter volume
-  TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.);
-  TGeoVolume* counter   = new TGeoVolume("counter", counter_box, noActiveGasVolMed);
-  counter->SetLineColor(kRed);   // set line color for the counter
-  counter->SetTransparency(70);  // set transparency for the TOF
-
-  // define single glass plate volume
-  TGeoBBox* glass_plate       = new TGeoBBox("", gdx / 2., gdy / 2., gdz / 2.);
-  TGeoVolume* glass_plate_vol = new TGeoVolume("tof_glass", glass_plate, glassPlateVolMed);
-  glass_plate_vol->SetLineColor(kMagenta);  // set line color for the glass plate
-  glass_plate_vol->SetTransparency(20);     // set transparency for the TOF
-  // define single gas gap volume
-  TGeoBBox* gas_gap       = new TGeoBBox("", ggdx / 2., ggdy / 2., ggdz / 2.);
-  TGeoVolume* gas_gap_vol = new TGeoVolume("Gap", gas_gap, activeGasVolMed);
-  gas_gap_vol->Divide("Cell", 1, nstrips, -ggdx / 2., 0);
-  gas_gap_vol->SetLineColor(kRed);   // set line color for the gas gap
-  gas_gap_vol->SetTransparency(99);  // set transparency for the TOF
-
-  // place 8 gas gaps and 9 glas plates in the counter
-  for (Int_t igap = 0; igap <= ngaps; igap++) {
-    // place (ngaps+1) glass plates
-    Float_t zpos_glas                  = startzposglas + igap * dzpos;
-    TGeoTranslation* glass_plate_trans = new TGeoTranslation("", 0., 0., zpos_glas);
-    counter->AddNode(glass_plate_vol, igap, glass_plate_trans);
-    // place ngaps gas gaps
-    if (igap < ngaps) {
-      Float_t zpos_gas               = startzposgas + igap * dzpos;
-      TGeoTranslation* gas_gap_trans = new TGeoTranslation("", 0., 0., zpos_gas);
-      counter->AddNode(gas_gap_vol, igap, gas_gap_trans);
-    }
-    //    cout <<"Zpos(Glas): "<< zpos_glas << endl;
-    //    cout <<"Zpos(Gas): "<< zpos_gas << endl;
-  }
-
-  // create and place the electronics above and below the glas stack
-  TGeoBBox* pcb       = new TGeoBBox("", dxe / 2., dye / 2., dze / 2.);
-  TGeoVolume* pcb_vol = new TGeoVolume("pcb", pcb, electronicsVolMed);
-  pcb_vol->SetLineColor(kYellow);  // kCyan); // set line color for electronics
-  pcb_vol->SetTransparency(10);    // set transparency for the TOF
-  for (Int_t l = 0; l < 2; l++) {
-    yele *= -1.;
-    TGeoTranslation* pcb_trans = new TGeoTranslation("", 0., yele, 0.);
-    counter->AddNode(pcb_vol, l, pcb_trans);
-  }
-
-
-  return counter;
-}
-
-TGeoVolume* create_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);
-
-  TGeoBBox* alu_box       = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* alu_box_vol = new TGeoVolume("alu_box", alu_box, boxVolMed);
-  alu_box_vol->SetLineColor(kGreen);  // set line color for the alu box
-  alu_box_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* alu_box_trans = new TGeoTranslation("", 0., 0., 0.);
-  module->AddNode(alu_box_vol, 0, alu_box_trans);
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kYellow);  // set line color for the gas box
-  gas_box_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < 5; j++) {  //loop over counters (modules)
-    Float_t zpos;
-    if (0 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = 0.;
-    }
-    //cout << "counter z position " << zpos << endl;
-    TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-TGeoVolume* create_new_tof_module(Int_t modType)
-{
-  Int_t cType         = CounterTypeInModule[modType];
-  Float_t dx          = Module_Size_X[modType];
-  Float_t dy          = Module_Size_Y[modType];
-  Float_t dz          = Module_Size_Z[modType];
-  Float_t width_aluxl = Module_Thick_Alu_X_left;
-  Float_t width_aluxr = Module_Thick_Alu_X_right;
-  Float_t width_aluy  = Module_Thick_Alu_Y;
-  Float_t width_aluz  = Module_Thick_Alu_Z;
-
-  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left) / 2;
-
-  Float_t dxpos     = CounterXDistance[modType];
-  Float_t startxpos = CounterXStartPosition[modType];
-  Float_t dypos     = CounterYDistance[modType];
-  Float_t startypos = CounterYStartPosition[modType];
-  Float_t dzoff     = CounterZDistance[modType];
-  Float_t rotangle  = CounterRotationAngle[modType];
-
-  TGeoMedium* boxVolMed         = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* noActiveGasVolMed = gGeoMan->GetMedium(NoActivGasMedium);
-
-  TString moduleName = Form("module_%d", modType);
-
-  TGeoBBox* module_box = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* module   = new TGeoVolume(moduleName, module_box, boxVolMed);
-  module->SetLineColor(kGreen);  // set line color for the alu box
-  module->SetTransparency(20);   // set transparency for the TOF
-
-  TGeoBBox* gas_box =
-    new TGeoBBox("", (dx - (width_aluxl + width_aluxr)) / 2., (dy - 2 * width_aluy) / 2., (dz - 2 * width_aluz) / 2.);
-  TGeoVolume* gas_box_vol = new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
-  gas_box_vol->SetLineColor(kBlue);  // set line color for the alu box
-  gas_box_vol->SetTransparency(50);  // set transparency for the TOF
-  TGeoTranslation* gas_box_trans = new TGeoTranslation("", shift_gas_box, 0., 0.);
-  module->AddNode(gas_box_vol, 0, gas_box_trans);
-
-  for (Int_t j = 0; j < NCounterInModule[modType]; j++) {  //loop over counters (modules)
-                                                           //for (Int_t j=0; j< 1; j++){ //loop over counters (modules)
-    Float_t xpos, ypos, zpos;
-    if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; }
-    else {
-      zpos = CounterZStartPosition[modType] + j * dzoff;
-    }
-    //cout << "counter z position " << zpos << endl;
-    xpos = startxpos + j * dxpos;
-    ypos = startypos + j * dypos;
-
-    TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos);
-
-    TGeoRotation* counter_rot = new TGeoRotation();
-    counter_rot->RotateY(rotangle);
-    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
-    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
-  }
-
-  return module;
-}
-
-
-TGeoVolume* create_tof_pole()
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t dx         = Pole_Size_X;
-  Float_t dy         = Pole_Size_Y;
-  Float_t dz         = Pole_Size_Z;
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* pole         = new TGeoVolumeAssembly("Pole");
-  TGeoBBox* pole_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* pole_alu_vol = new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
-  pole_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  pole_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* pole_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);
-
-  Float_t air_dx = dx / 2. - width_alux;
-  Float_t air_dy = dy / 2. - width_aluy;
-  Float_t air_dz = dz / 2. - width_aluz;
-
-  //  cout << "My pole." << endl;
-  if (air_dx <= 0.) cout << "ERROR - No air volume in pole X, size: " << air_dx << endl;
-  if (air_dy <= 0.) cout << "ERROR - No air volume in pole Y, size: " << air_dy << endl;
-  if (air_dz <= 0.) cout << "ERROR - No air volume in pole Z, size: " << air_dz << endl;
-
-  if ((air_dx > 0.) && (air_dy > 0.) && (air_dz > 0.))  // crate air volume only, if larger than zero
-  {
-    TGeoBBox* pole_air_box = new TGeoBBox("", air_dx, air_dy, air_dz);
-    //  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
-    TGeoVolume* pole_air_vol = new TGeoVolume("pole_air", pole_air_box, airVolMed);
-    pole_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-    pole_air_vol->SetTransparency(70);    // set transparency for the TOF
-    TGeoTranslation* pole_air_trans = new TGeoTranslation("", 0., 0., 0.);
-    pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);
-  }
-  else
-    cout << "Skipping pole_air_vol, no thickness: " << air_dx << " " << air_dy << " " << air_dz << endl;
-
-  return pole;
-}
-
-TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
-{
-  // needed materials
-  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
-  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
-
-  Float_t width_alux = Pole_Thick_X;
-  Float_t width_aluy = Pole_Thick_Y;
-  Float_t width_aluz = Pole_Thick_Z;
-
-  TGeoVolume* bar         = new TGeoVolumeAssembly("Bar");
-  TGeoBBox* bar_alu_box   = new TGeoBBox("", dx / 2., dy / 2., dz / 2.);
-  TGeoVolume* bar_alu_vol = new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
-  bar_alu_vol->SetLineColor(kGreen);  // set line color for the alu box
-  bar_alu_vol->SetTransparency(20);   // set transparency for the TOF
-  TGeoTranslation* bar_alu_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);
-
-  TGeoBBox* bar_air_box   = new TGeoBBox("", dx / 2. - width_alux, dy / 2. - width_aluy, dz / 2. - width_aluz);
-  TGeoVolume* bar_air_vol = new TGeoVolume("bar_air", bar_air_box, airVolMed);
-  bar_air_vol->SetLineColor(kYellow);  // set line color for the alu box
-  bar_air_vol->SetTransparency(70);    // set transparency for the TOF
-  TGeoTranslation* bar_air_trans = new TGeoTranslation("", 0., 0., 0.);
-  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);
-
-  return bar;
-}
-
-void position_tof_poles(Int_t modType)
-{
-
-  TGeoTranslation* pole_trans = NULL;
-
-  Int_t numPoles = 0;
-  for (Int_t i = 0; i < NumberOfPoles; i++) {
-    if (i < 2) {
-      pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    else {
-      Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl;
-      Float_t zPos = Pole_ZPos[i];
-      pole_trans   = new TGeoTranslation("", xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-
-      pole_trans = new TGeoTranslation("", -xPos, 0., zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans);
-      numPoles++;
-    }
-    cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl;
-  }
-}
-
-void position_tof_bars(Int_t modType)
-{
-
-  TGeoTranslation* bar_trans = NULL;
-
-  Int_t numBars = 0;
-  Int_t i;
-  Float_t xPos;
-  Float_t yPos;
-  Float_t zPos;
-
-  for (i = 0; i < NumberOfBars; i++) {
-
-    xPos = Bar_XPos[i];
-    zPos = Bar_ZPos[i];
-    yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.;
-
-    bar_trans = new TGeoTranslation("", xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-
-    bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-    numBars++;
-  }
-  cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl;
-
-  // horizontal frame bars
-  i = NumberOfBars;
-  NumberOfBars++;
-  // no bar
-  //   gBar[i]=create_tof_bar(2.*xPos+Pole_Size_X,Bar_Size_Y,Bar_Size_Y);
-
-  zPos      = Pole_ZPos[0] + Pole_Size_Z / 2.;
-  bar_trans = new TGeoTranslation("", 0., yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-
-  bar_trans = new TGeoTranslation("", 0., -yPos, zPos);
-  gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans);
-  numBars++;
-}
-
-void position_inner_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Inner_Module_X_Offset;
-  Float_t zPos = Wall_Z_Position;
-
-  Pole_ZPos[NumberOfPoles] = zPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  Float_t DzPos = 0.;
-  for (Int_t j = 0; j < modNType; j++) {
-    if (Module_Size_Z[j] > DzPos) { DzPos = Module_Size_Z[j]; }
-  }
-  Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-  Pole_Col[NumberOfPoles]  = 0;
-  NumberOfPoles++;
-
-  // Mar2019 setup
-  Int_t modNum[4]                = {4 * 0};
-  const Int_t NModules           = 8;
-  xPos                           = 0.;
-  yPos                           = 0.;
-  zPos                           = TOF_Z_Front;
-  const Int_t ModType[NModules]  = {0, 0, 0, 0, 0, 2, 2, 2};
-  const Double_t ModDx[NModules] = {-50., 0., 50., -25., 25.0, -37.5, 37.5, 0.0};
-  //const Double_t ModDx[NModules]= { 1.5,    0., -1.5, 49.8, 55.8};
-  const Double_t ModDy[NModules]     = {0., 0., 0., 0., 0., 0., 0., 0.};
-  const Double_t ModDz[NModules]     = {0., 0, 0, 16.5, 16.5, 33., 33., 49.5};
-  const Double_t ModAng[NModules]    = {-90., -90., -90., -90., -90.0, -90.0, -90.0, -90.0};
-  TGeoRotation* module_rot           = NULL;
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  /*
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    if (iMod < 5) { gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[0], modNum, module_combi_trans); }
-    else {
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[2], modNum, module_combi_trans);
-    }
-    modNum++;
-  }
-*/
-
-  for (Int_t iMod = 0; iMod < NModules; iMod++) {
-    module_trans = new TGeoTranslation("", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]);
-    module_rot   = new TGeoRotation();
-    module_rot->RotateZ(ModAng[iMod]);
-    module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-    gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[ModType[iMod]], modNum[ModType[iMod]], module_combi_trans);
-    cout << "Placed Module " << modNum[ModType[iMod]] << ", Type " << ModType[iMod] << endl;
-    modNum[ModType[iMod]]++;
-  }
-
-  /*
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- 
- // module_trans = new TGeoTranslation("", xPos, 49+3, zPos);
- module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
-
- // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]);
- module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5);
- gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
- modNum++;
- */
-}
-
-
-void position_Dia(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Dia_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = Dia_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = Dia_X_Offset;
-  Float_t zPos = Dia_Z_Position;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Dia_Types[j];
-    for (Int_t i = 0; i < Dia_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_Star2(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Star2_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Star2_First_Y_Position;
-  Float_t zPos = Star2_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Star2_Types[j];
-    Float_t xPos  = Star2_X_Offset[j];
-    for (Int_t i = 0; i < Star2_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Star2_Delta_Y_Position;
-      zPos += Star2_Delta_Z_Position;
-    }
-  }
-}
-
-void position_Buc(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(Buc_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  Float_t yPos = Buc_First_Y_Position;
-  Float_t zPos = Buc_First_Z_Position;
-  Int_t ii     = 0;
-
-  Int_t modNum = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = Buc_Types[j];
-    Float_t xPos  = Buc_X_Offset[j];
-    for (Int_t i = 0; i < Buc_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-      yPos += Buc_Delta_Y_Position;
-      zPos += Buc_Delta_Z_Position;
-    }
-  }
-}
-
-void position_cer_modules(Int_t modNType)
-{
-  Int_t ii     = 0;
-  Int_t modNum = 0;
-  for (Int_t j = 1; j < modNType; j++) {
-    Int_t modType                 = Cer_Types[j];
-    Float_t xPos                  = Cer_X_Position[j];
-    Float_t yPos                  = Cer_Y_Position[j];
-    Float_t zPos                  = Cer_Z_Position[j];
-    TGeoTranslation* module_trans = NULL;
-    TGeoRotation* module_rot      = new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.);
-    // module_rot->RotateZ(Cer_rotate_Z[j]);
-    TGeoCombiTrans* module_combi_trans = NULL;
-
-    for (Int_t i = 0; i < Cer_Number[j]; i++) {
-      ii++;
-      cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] << " Type " << modType << " at X = " << xPos
-           << ", Y = " << yPos << ", Z = " << zPos << endl;
-      // Front staggered module (Top if pair), top
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      //    modNum++;
-    }
-  }
-}
-
-void position_CERN(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(CERN_rotate_Z);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = CERN_First_Y_Position;
-  Int_t ii     = 0;
-  Float_t xPos = CERN_X_Offset;
-  Float_t zPos = CERN_Z_Position;
-
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = CERN_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < CERN_Number[j]; i++) {
-      ii++;
-      module_trans       = new TGeoTranslation("", xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-    }
-  }
-}
-
-void position_side_tof_modules(Int_t modNType)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-  Float_t yPos = 0.;  //Inner_Module_First_Y_Position;
-  Int_t ii     = 0;
-  for (Int_t j = 0; j < modNType; j++) {
-    Int_t modType = InnerSide_Module_Types[j];
-    Int_t modNum  = 0;
-    for (Int_t i = 0; i < InnerSide_Module_Number[j]; i++) {
-      ii++;
-      cout << "InnerSide ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-      Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-      if (ii > 1) { yPos += DeltaY; }
-      Last_Size_Y  = Module_Size_Y[modType];
-      Last_Over_Y  = Module_Over_Y[modType];
-      Float_t xPos = InnerSide_Module_X_Offset;
-      Float_t zPos = Wall_Z_Position;
-      cout << "Position InnerSide Module " << i << " of " << InnerSide_Module_Number[j] << " Type " << modType
-           << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-      module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-      modNum++;
-
-      module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-      module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-      gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-      modNum++;
-
-      if (ii > 1) {
-        module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-
-        module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans);
-        modNum++;
-
-        module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_combi_trans);
-        modNum++;
-      }
-    }
-  }
-}
-
-void position_outer_tof_modules(Int_t nCol)  //modType, Int_t col1, Int_t col2)
-{
-  TGeoTranslation* module_trans = NULL;
-  TGeoRotation* module_rot      = new TGeoRotation();
-  module_rot->RotateZ(180.);
-  TGeoCombiTrans* module_combi_trans = NULL;
-
-  //  Int_t numModules=(Int_t)( (Outer_Module_Last_Y_Position-Outer_Module_First_Y_Position)/Module_Size_Y[modType])+1;
-
-  Int_t modNum[NofModuleTypes];
-  for (Int_t k = 0; k < NofModuleTypes; k++) {
-    modNum[k] = 0;
-  }
-
-  Float_t zPos = Wall_Z_Position;
-  for (Int_t j = 0; j < nCol; j++) {
-    Float_t xPos  = Outer_Module_X_Offset + ((j + 1) * DxColl);
-    Last_Size_Y   = 0.;
-    Last_Over_Y   = 0.;
-    Float_t yPos  = 0.;
-    Int_t ii      = 0;
-    Float_t DzPos = 0.;
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType = Outer_Module_Types[k][j];
-      if (Module_Size_Z[modType] > DzPos) {
-        if (Outer_Module_Number[k][j] > 0) { DzPos = Module_Size_Z[modType]; }
-      }
-    }
-
-    zPos -= 2. * DzPos;  //((j+1)*2*Module_Size_Z[modType]);
-
-    Pole_ZPos[NumberOfPoles] = zPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    Pole_ZPos[NumberOfPoles] = zPos + DzPos;
-    Pole_Col[NumberOfPoles]  = j + 1;
-    NumberOfPoles++;
-    //if (j+1==nCol) {
-    if (1) {
-      Pole_ZPos[NumberOfPoles] = Pole_ZPos[0];
-      Pole_Col[NumberOfPoles]  = j + 1;
-      NumberOfPoles++;
-
-      Bar_Size_Z             = Pole_ZPos[0] - zPos;
-      gBar[NumberOfBars]     = create_tof_bar(Bar_Size_X, Bar_Size_Y, Bar_Size_Z);
-      Bar_ZPos[NumberOfBars] = zPos + Bar_Size_Z / 2. - Pole_Size_Z / 2.;
-      Bar_XPos[NumberOfBars] = xPos + Pole_Offset;
-      NumberOfBars++;
-    }
-
-    for (Int_t k = 0; k < Outer_Module_NTypes; k++) {
-      Int_t modType    = Outer_Module_Types[k][j];
-      Int_t numModules = Outer_Module_Number[k][j];
-
-      cout << " Outer: position " << numModules << " of type " << modType << " in col " << j << " at z = " << zPos
-           << ", DzPos = " << DzPos << endl;
-      for (Int_t i = 0; i < numModules; i++) {
-        ii++;
-        cout << "Outer ii " << ii << " Last " << Last_Size_Y << "," << Last_Over_Y << endl;
-        Float_t DeltaY = Module_Size_Y[modType] + Last_Size_Y - 2. * (Module_Over_Y[modType] + Last_Over_Y);
-        if (ii > 1) { yPos += DeltaY; }
-        Last_Size_Y = Module_Size_Y[modType];
-        Last_Over_Y = Module_Over_Y[modType];
-        cout << "Position Outer Module " << i << " of " << Outer_Module_Number[k][j] << " Type " << modType << "(#"
-             << modNum[modType] << ") "
-             << " at Y = " << yPos << " Ysize = " << Module_Size_Y[modType] << " DeltaY = " << DeltaY << endl;
-
-        module_trans = new TGeoTranslation("", xPos, yPos, zPos);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-        modNum[modType]++;
-
-        module_trans       = new TGeoTranslation("", -xPos, yPos, zPos);
-        module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-        gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-        modNum[modType]++;
-
-        if (ii > 1) {
-          module_trans = new TGeoTranslation("", xPos, -yPos, zPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -yPos, zPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          // second layer
-          module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-
-          module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_trans);
-          modNum[modType]++;
-          module_trans       = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos);
-          module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot);
-          gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum[modType], module_combi_trans);
-          modNum[modType]++;
-        }
-      }
-    }
-  }
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  printf("writing info file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  fprintf(ifile, "# TOF setup\n");
-  if (TOF_Z_Front == 450) fprintf(ifile, "SIS 100 hadron setup\n");
-  if (TOF_Z_Front == 600) fprintf(ifile, "SIS 100 electron\n");
-  if (TOF_Z_Front == 650) fprintf(ifile, "SIS 100 muon\n");
-  if (TOF_Z_Front == 880) fprintf(ifile, "SIS 300 electron\n");
-  if (TOF_Z_Front == 1020) fprintf(ifile, "SIS 300 muon\n");
-  fprintf(ifile, "\n");
-
-  const Float_t TOF_Z_Back = Wall_Z_Position + 1.5 * Module_Size_Z[0];  // back of TOF wall
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%7.2f cm   start of TOF (z)\n", TOF_Z_Front);
-  fprintf(ifile, "%7.2f cm   end   of TOF (z)\n", TOF_Z_Back);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# central tower position\n");
-  fprintf(ifile, "%7.2f cm   center of staggered, front RPC cell at x=0\n", Wall_Z_Position);
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
diff --git a/macro/mcbm/geometry/tof/HowTo_digipar.txt b/macro/mcbm/geometry/tof/HowTo_digipar.txt
deleted file mode 100644
index 3ce27a4d33..0000000000
--- a/macro/mcbm/geometry/tof/HowTo_digipar.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-##   Howto generate digi.par files for mTOF
-#
-
-# November 2017
-
-# by Pierre and David
-
-1) Create the geo root file vXXX_mcbm
-2) Place it in the trunk/geometry/tof folder
-3) Howto create the digi.par file:
-cd trunk/macro/tof/geometry
-root -l -q 'make_geofile.C("tof_vXXi_mcbm")'
-root -l 'create_digipar.C("tof_vXXi_mcbm")'
-4) Copy the digi.par in parameters/tof
-cp tof_vXXi_mcbm.digi.par trunk/parameters/tof
-5) cd parameters/tof
-ln -s tof_v18e_mcbm.digibdf.par tof_v18i_mcbm.digibdf.par
diff --git a/macro/mcbm/geometry/tof/create_digipar.C b/macro/mcbm/geometry/tof/create_digipar.C
deleted file mode 100644
index 78ce60f5fb..0000000000
--- a/macro/mcbm/geometry/tof/create_digipar.C
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright (C) 2020 PI-UHd, GSI
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig, Norbert Herrmann [committer] */
-
-// --------------------------------------------------------------------------
-//
-// Macro to create digi parameters for the TOF
-//
-// The way how the pad layout looks like has to be
-// implemented in a task called in this macro.
-// CbmTofCreateDigiPar is the implementation used
-// here.
-//
-// F.Uhlig 07.05.2010
-//
-// --------------------------------------------------------------------------
-
-
-void create_digipar(TString fileName = "tof_v16a_1e", Int_t nEvents = 0)
-{
-
-  cout << "fileName: " << fileName << endl;
-
-
-  // ========================================================================
-  //          Adjust this part according to your requirements
-
-  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
-  Int_t iVerbose = 0;
-
-  // Input file (MC events)
-  TString inFile = "auaumbias." + fileName + ".mc.root";
-
-  // Geometry File
-  TString geoFile = "geofile_" + fileName + ".root";
-
-  // Output file
-  TString outFile = "test.esd." + fileName + ".root";
-
-  // Digi Parameter Output File
-  //  TString digiFile = fileName + ".digi.par.long";
-  TString digiFile = fileName + ".digi.par";
-
-  // In general, the following parts need not be touched
-  // ========================================================================
-
-
-  // ----    Debug option   -------------------------------------------------
-  gDebug = 0;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Timer   --------------------------------------------------------
-  TStopwatch timer;
-  timer.Start();
-  // ------------------------------------------------------------------------
-
-
-  // -----   Reconstruction run   -------------------------------------------
-  FairRunAna* run = new FairRunAna();
-  //run->SetInputFile(inFile);
-  //run->SetOutputFile(outFile);
-  run->SetGeomFile(geoFile);
-  //FairLogger::GetLogger()->SetLogScreenLevel("INFO");
-  FairLogger::GetLogger()->SetLogScreenLevel("DEBUG2");
-  // ------------------------------------------------------------------------
-
-  FairRuntimeDb* rtdb = run->GetRuntimeDb();
-
-  FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
-  parIo2->open(digiFile, "out");
-  rtdb->setOutput(parIo2);
-
-  CbmTofCreateDigiPar* tofDigiProducer = new CbmTofCreateDigiPar("TOF Digi Producer", "TOF task");
-  run->AddTask(tofDigiProducer);
-
-  // -------------------------------------------------------------------------
-
-  rtdb->saveOutput();
-
-  // -----   Intialise and run   --------------------------------------------
-  //  run->LoadGeometry();
-  run->Init();
-
-  rtdb->print();
-
-
-  CbmTofDigiPar* DigiPar = (CbmTofDigiPar*) rtdb->getContainer("CbmTofDigiPar");
-
-  DigiPar->setChanged();
-  DigiPar->setInputVersion(run->GetRunId(), 1);
-  rtdb->print();
-  rtdb->saveOutput();
-
-
-  // -----   Finish   -------------------------------------------------------
-  timer.Stop();
-  Double_t rtime = timer.RealTime();
-  Double_t ctime = timer.CpuTime();
-  cout << endl << endl;
-  cout << "Macro finished succesfully." << endl;
-  cout << "Output file is " << outFile << endl;
-  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-  cout << " Test passed" << endl;
-  cout << " All ok " << endl;
-  exit(0);
-}
diff --git a/macro/mcbm/geometry/tof/create_parfiles.sh b/macro/mcbm/geometry/tof/create_parfiles.sh
deleted file mode 100755
index 551d7e1e48..0000000000
--- a/macro/mcbm/geometry/tof/create_parfiles.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-# Copyright (C) 2020 PI-UHd,GSI
-# SPDX-License-Identifier: GPL-3.0-only
-# First commited by Norbert Herrmann
-
-VGEO=$1
-Setup=$2
-
-if [[ $Setup = "" ]]; then
- Setup=mcbm_beam_2020_03
-fi 
-
-root -l -q Create_TOF_Geometry_${VGEO}.C
-#cp tof_v14a.root tof_${VGEO}.root
-cp -v tof_${VGEO}.geo.root ../../../../geometry/tof/
-
-#cp -v tof_${VGEO}_geo.root ../../../../geometry/tof/geofile_tof_${VGEO}.root
-#cp -v tof_${VGEO}_geo.root  ./geofile_tof_${VGEO}.root
-
-CURDIR=`pwd`
-cd ../..
-rm -v test*.root
-rm -v ${Setup}*.root
-root -l -q './mcbm_transport.C(0,"'$Setup'")'
-#cp -v ./${Setup}.geo.root     ./geometry/tof/geofile_tof_${VGEO}.root
-#cp -v ./${Setup}.geo.root ../../geometry/tof/geofile_tof_${VGEO}.root
-cp -v ./data/test.geo.root     ./geometry/tof/geofile_tof_${VGEO}.root
-cp -v ./data/test.geo.root ../../geometry/tof/geofile_tof_${VGEO}.root
-cp -v ./data/test.par.root     ./geometry/tof/tof_${Setup}.par.root
-cd $CURDIR
-
-#rm ../../../../parameters/tof/tof_${VGEO}.digi.par
-#root -l 'create_digipar.C("tof_'${VGEO}'")'
-#cp tof_${VGEO}.digi.par      ../../../../parameters/tof/
-#cp geofile_tof_${VGEO}.root  ../../../../geometry/tof/
diff --git a/macro/mcbm/geometry/tof/create_tof_digipar.C b/macro/mcbm/geometry/tof/create_tof_digipar.C
deleted file mode 100644
index 1981e680ab..0000000000
--- a/macro/mcbm/geometry/tof/create_tof_digipar.C
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Copyright (C) 2017-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig, David Emschermann [committer] */
-
-// --------------------------------------------------------------------------
-//
-// Macro to create digi parameters for the TOF
-//
-// The way how the pad layout looks like has to be
-// implemented in a task called in this macro.
-// CbmTofCreateDigiPar is the implementation used
-// here.
-//
-// F.Uhlig 07.05.2010
-//
-// --------------------------------------------------------------------------
-
-
-void create_tof_digipar(TString fileName = "tof_v16a_1e", Int_t nEvents = 0)
-{
-
-  cout << "fileName: " << fileName << endl;
-
-
-  // ========================================================================
-  //          Adjust this part according to your requirements
-
-  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
-  Int_t iVerbose = 0;
-
-  // Input file (MC events)
-  TString inFile = "auaumbias." + fileName + ".mc.root";
-
-  // Geometry File
-  TString geoFile = fileName + "_geo.root";
-
-  // Output file
-  TString outFile = "test.esd." + fileName + ".root";
-
-  // Digi Parameter Output File
-  //  TString digiFile = fileName + ".digi.par.long";
-  TString digiFile = fileName + ".digi.par";
-
-  // In general, the following parts need not be touched
-  // ========================================================================
-
-
-  // ----    Debug option   -------------------------------------------------
-  gDebug = 0;
-  // ------------------------------------------------------------------------
-
-
-  // -----   Timer   --------------------------------------------------------
-  TStopwatch timer;
-  timer.Start();
-  // ------------------------------------------------------------------------
-
-
-  // -----   Reconstruction run   -------------------------------------------
-  FairRunAna* run = new FairRunAna();
-  //  run->SetInputFile(inFile);
-  run->SetOutputFile(outFile);
-  run->SetGeomFile(geoFile);
-  FairLogger::GetLogger()->SetLogScreenLevel("DEBUG2");
-  FairLogger::GetLogger()->SetLogVerbosityLevel("VERYHIGH");
-
-  // ------------------------------------------------------------------------
-
-  FairRuntimeDb* rtdb = run->GetRuntimeDb();
-
-  FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
-  parIo2->open(digiFile, "out");
-  rtdb->setOutput(parIo2);
-
-  CbmTofCreateDigiPar* tofDigiProducer = new CbmTofCreateDigiPar("TOF Digi Producer", "TOF task");
-  run->AddTask(tofDigiProducer);
-
-  // -------------------------------------------------------------------------
-
-  rtdb->saveOutput();
-
-  // -----   Intialise and run   --------------------------------------------
-  //  run->LoadGeometry();
-  run->Init();
-
-  rtdb->print();
-
-
-  CbmTofDigiPar* DigiPar = (CbmTofDigiPar*) rtdb->getContainer("CbmTofDigiPar");
-
-  DigiPar->setChanged();
-  DigiPar->setInputVersion(run->GetRunId(), 1);
-  rtdb->print();
-  rtdb->saveOutput();
-
-
-  // -----   Finish   -------------------------------------------------------
-  timer.Stop();
-  Double_t rtime = timer.RealTime();
-  Double_t ctime = timer.CpuTime();
-  cout << endl << endl;
-  cout << "Macro finished succesfully." << endl;
-  cout << "Output file is " << outFile << endl;
-  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
-  cout << endl;
-  // ------------------------------------------------------------------------
-
-  cout << " Test passed" << endl;
-  cout << " All ok " << endl;
-  exit(0);
-}
diff --git a/macro/mcbm/geometry/tof/create_tof_geometry.sh b/macro/mcbm/geometry/tof/create_tof_geometry.sh
deleted file mode 100755
index 92e042e76d..0000000000
--- a/macro/mcbm/geometry/tof/create_tof_geometry.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-# Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-# SPDX-License-Identifier: GPL-3.0-only
-# First commited by David Emschermann
-
-VGEO=$1
-
-echo ${VGEO}
-
-root -l -q Create_TOF_Geometry_${VGEO}_mcbm.C
-cp tof_${VGEO}_mcbm.geo.root ../../../../geometry/tof/tof_${VGEO}_mcbm.geo.root
-cp tof_${VGEO}_mcbm.geo.info ../../../../geometry/tof/tof_${VGEO}_mcbm.geo.info
-root -l 'create_tof_digipar.C("tof_'${VGEO}'_mcbm")'
-cp tof_${VGEO}_mcbm.digi.par ../../../../parameters/tof/tof_${VGEO}_mcbm.digi.par
-rm tof_${VGEO}_mcbm* test.esd.tof_${VGEO}_mcbm.root
diff --git a/macro/mcbm/geometry/trd/.rootrc b/macro/mcbm/geometry/trd/.rootrc
deleted file mode 120000
index 3a0c80486b..0000000000
--- a/macro/mcbm/geometry/trd/.rootrc
+++ /dev/null
@@ -1 +0,0 @@
-../../../include/.rootrc
\ No newline at end of file
diff --git a/macro/mcbm/geometry/trd/CbmTrdPads_v18q_mcbm.h b/macro/mcbm/geometry/trd/CbmTrdPads_v18q_mcbm.h
deleted file mode 100644
index 473af0e7cc..0000000000
--- a/macro/mcbm/geometry/trd/CbmTrdPads_v18q_mcbm.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-//
-//   TRD pad layout for geometry v18q_mcbm
-//
-// automatically generated by Create_TRD_Geometry_v18q_mcbm_1e.C
-// created 20200331
-//
-
-#ifndef CBMTRDPADS_H
-#define CBMTRDPADS_H
-
-Int_t fst1_sect_count = 3;
-// array of pad geometries in the TRD (trd1mod[1-8])
-// 8 modules  // 3 sectors  // 4 values
-Float_t fst1_pad_type[8][3][4] =
-
-  // module type 1
-  // number of pads:  80 x 36 = 2880
-  // pad size sector 1:  0.68 cm x  1.50 cm =  1.01 cm2
-  // pad size sector 0:  0.68 cm x  1.50 cm =  1.01 cm2
-  {{{54.0, 18.00, 54.0 / 80, 1.50}, {54.0, 18.00, 54.0 / 80, 1.50}, {54.0, 18.00, 54.0 / 80, 1.50}},
-
-   // module type 2
-   // number of pads:  80 x 24 = 1920
-   // pad size sector 1:  0.68 cm x  2.25 cm =  1.52 cm2
-   // pad size sector 0:  0.68 cm x  2.25 cm =  1.52 cm2
-   {{54.0, 18.00, 54.0 / 80, 2.25}, {54.0, 18.00, 54.0 / 80, 2.25}, {54.0, 18.00, 54.0 / 80, 2.25}},
-
-   // module type 3
-   // number of pads:  80 x 12 =  960
-   // pad size sector 1:  0.68 cm x  4.50 cm =  3.04 cm2
-   // pad size sector 0:  0.68 cm x  4.50 cm =  3.04 cm2
-   {{54.0, 18.00, 54.0 / 80, 4.50}, {54.0, 18.00, 54.0 / 80, 4.50}, {54.0, 18.00, 54.0 / 80, 4.50}},
-
-   // module type 4
-   // number of pads:  72 x 20 = 1440
-   // pad size sector 1:  0.75 cm x  2.79 cm =  2.09 cm2
-   // pad size sector 0:  0.75 cm x  2.79 cm =  2.09 cm2
-   {{54.0, 5.58, 54.0 / 72, 2.79}, {54.0, 44.64, 54.0 / 72, 2.79}, {54.0, 5.58, 54.0 / 72, 2.79}},
-
-   //---
-
-   // module type 5
-   // number of pads: 128 x 24 = 3072
-   // pad size sector 1:  0.72 cm x  4.00 cm =  2.88 cm2
-   // pad size sector 0:  0.72 cm x  3.75 cm =  2.70 cm2
-   {{92.0, 30.00, 92.0 / 128, 3.75}, {92.0, 32.00, 92.0 / 128, 4.00}, {92.0, 30.00, 92.0 / 128, 3.75}},
-
-   // module type 6
-   // number of pads: 128 x 16 = 2048
-   // pad size sector 1:  0.72 cm x  5.75 cm =  4.13 cm2
-   // pad size sector 0:  0.72 cm x  5.75 cm =  4.13 cm2
-   {{92.0, 23.00, 92.0 / 128, 5.75}, {92.0, 46.00, 92.0 / 128, 5.75}, {92.0, 23.00, 92.0 / 128, 5.75}},
-
-   // module type 7
-   // number of pads: 128 x  8 = 1024
-   // pad size sector 1:  0.72 cm x 11.50 cm =  8.27 cm2
-   // pad size sector 0:  0.72 cm x 11.50 cm =  8.27 cm2
-   {{92.0, 23.00, 92.0 / 128, 11.50}, {92.0, 46.00, 92.0 / 128, 11.50}, {92.0, 23.00, 92.0 / 128, 11.50}},
-
-   // module type 8
-   // number of pads: 128 x  6 =  768
-   // pad size sector 1:  0.72 cm x 15.50 cm = 11.14 cm2
-   // pad size sector 0:  0.72 cm x 15.25 cm = 10.96 cm2
-   {{92.0, 30.50, 92.0 / 128, 15.25}, {92.0, 31.00, 92.0 / 128, 15.50}, {92.0, 30.50, 92.0 / 128, 15.25}}};
-
-#endif
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v17s.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v17s.C
deleted file mode 100644
index 9ea05ddfca..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v17s.C
+++ /dev/null
@@ -1,3730 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v17s.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-08-15 - DE - v17s    - TRD setup for SPS beamtest 2017
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v17s";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 150., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 20.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 100., 0., 5.,
-                                         0., 0., 0.,   5., 0.};  // SPS 2017 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   5.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 80, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 0,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 4, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 105, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-//void Create_TRD_Geometry_v17s(const Int_t setupid = 1) {
-void Create_TRD_Geometry_v17s()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // number of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},  // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},  // module type 3
-     {2, 4, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          //	  xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18a_1e.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18a_1e.C
deleted file mode 100644
index 85f026bd7c..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18a_1e.C
+++ /dev/null
@@ -1,3310 +0,0 @@
-/* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18a.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2015-06-26 - DE - v18a_mcbm - 2 layers of 2x2 module type 3 for mCBM setup @ SIS 18
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18a";
-//const TString subVersion   = "_1h";
-const TString subVersion = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-const TString geoVersion   = "trd_" + tagVersion + subVersion;
-const TString FileNameSim  = "m" + geoVersion + ".geo.root";
-const TString FileNameGeo  = "m" + geoVersion + "_geo.root";
-const TString FileNameInfo = "m" + geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = true;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;  // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;  // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;  // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;  // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;  // false;  // true, if backpanel is included in geometry
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = true;   // support structure must be there, otherwise there are no TRDpoints in sim
-const Bool_t IncludeLabels      = true;   // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-const Double_t feb_rotation_angle =
-  45;  //0.1; // 65.; // 70.; // 0.;   // rotation around x-axis, should be < 90 degrees
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-const Int_t ShowLayer[MaxLayers] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-// 5x z-positions from 260 till 550 cm
-Double_t LayerPosition[MaxLayers] = {400.};  // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 450. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 45.0;  // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., 5.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-//const Int_t LayerArraySize[3][4] =  { { 5, 5, 9, 11 },    // for layer[1-3][i,o] below
-const Int_t LayerArraySize[3][4] = {{4, 4, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//const Int_t layer1i[5][5] = { { 0,   0,   0,  0,  0 },    // abc: a module type - b orientation (x90 deg) in odd - c even layer s
-const Int_t layer1i[4][4] = {{0, 0, 0, 0},  // abc: a module type - b orientation (x90 deg) in odd - c even layer s
-                             {0, 323, 321, 0},
-                             {0, 303, 301, 0},
-                             {0, 0, 0, 0}};
-
-//// mCBM with 3x3 arrangement
-//const Int_t layer1i[5][5] = { { 0,     0,   0,    0,  0 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//			      { 0,  123,  121,  121,  0 },
-//			      { 0,  103,  101,  101,  0 },
-//			      { 0,  103,  101,  101,  0 },
-//			      { 0,     0,   0,    0,  0 } };
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-//// number of modules: 24
-//
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {2, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {107, 105, 103, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {14, 8,  5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {77, 53, 5, 0,
-                                               0,  55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-// ultimate density - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {6,  5, 6, 4,
-                                             12, 8, 4, 3};  // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-const Int_t AsicsPerFeb[NofModuleTypes]   = {315, 210, 105, 105, 108,
-                                           108, 108, 108};  //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.2;  // 2 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // asic_thickness; // 2.5 mm
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-//const Double_t asic_distance  = 0.4;  // 0.40; // a factor of width for ASIC pairs
-Double_t asic_distance;  //  = 0.40; // for 10 ASICs - a factor of width for ASIC pairs
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-//const Double_t radiator_thickness     =  35.0;    // 35 cm thickness of radiator
-const Double_t radiator_thickness = 30.0;  // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position  = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// readout boards
-const Double_t febvol_thickness = 10.0;  // 10 cm length of FEBs
-const Double_t febvol_position  = carbon_position + carbon_thickness / 2. + febvol_thickness / 2.;
-const Double_t feb_thickness    = 0.25;  // light //  2.5 mm thickness of FEBs
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18a_1e()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) {
-    //    create_xtru_supports();
-    create_box_supports();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  //  top->Export(FileNameSim);   // an alternative way of writing the top volume
-
-  TFile* outfile = new TFile(FileNameSim, "RECREATE");
-  top->Write();  // use this as input to simulations (run_sim.C)
-  outfile->Close();
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // numer of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.75, 2.50, 2.75},                                          // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},                                          // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},                                          // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 4, 8},                                              // module type 2
-     {1, 10, 1},                                             // module type 3
-     {2, 4, 2},                                              // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on Module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("module%d_frame1", moduleType), trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("trd1mod%dframe1", moduleType), trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("module%d_frame2", moduleType), trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("trd1mod%dframe2", moduleType), trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * febvol_thickness /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * febvol_thickness /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -febvol_thickness / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         febvol_thickness / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("", activeAreaX / 2., feb_thickness / 2.,
-                                     febvol_thickness / 2.);        // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    Double_t asic_pos;
-    Double_t asic_pos_x;
-    TGeoTranslation* trd_asic_trans1;  // center to corner
-
-    if (IncludeAsics) {
-      TGeoHMatrix* incline_asic;
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos   = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      feb_pos_y = feb_pos * activeAreaY;
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_size_y    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);  //, "" ); // incline_feb);
-
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = 2;
-      Int_t nofGbtxY = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-
-        gbtx_pos = (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_y = -gbtx_pos * rob_size_y;
-
-        if (iGbtxY > 0)
-          for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-            gbtx_pos =
-              (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_x = gbtx_pos * rob_size_x;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_x = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        trd_rob_y_position =
-          new TGeoTranslation("", 0., rob_pos_y,
-                              febvol_thickness / 2. - rob_thickness);     // approximate pos at end of feb volume
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvol_trans = new TGeoTranslation("", 0., 0., febvol_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvol_trans);  // put febvol at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          // DEDE
-          // 3x3
-          // 3x3          Int_t y = -(j-2);
-          // 3x3          Int_t x =   i-2;
-          Double_t y = -(j - 1.5);
-          Double_t x = i - 1.5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Double_t y = -(j - 4);
-          Double_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  //  const Double_t AperX[3] = { 4.5*DetectorSizeX[1], 5.5*DetectorSizeX[1], 6*DetectorSizeX[1] };  // inner aperture in X of support structure for stations 1,2,3
-  //  const Double_t AperY[3] = { 3.5*DetectorSizeY[1], 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture in Y of support structure for stations 1,2,3
-  const Double_t AperX[3] = {2.5 * DetectorSizeX[0], 2.5 * DetectorSizeX[0],
-                             2.5 * DetectorSizeX[0]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {2.5 * DetectorSizeY[0], 2.5 * DetectorSizeY[0],
-                             2.5 * DetectorSizeY[0]};  // inner aperture in Y of support structure for stations 1,2,3
-
-  // platform
-  //  const Double_t AperYbot[3] = { BeamHeight-(PlatformHeight+PlatformOffset+I_height), 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture for station1
-  const Double_t AperYbot[3] = {2.5 * DetectorSizeY[0], 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1 = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep = new TGeoBBox("", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3    = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1 = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep = new TGeoBBox("", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3    = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1 = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep = new TGeoBBox("", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3    = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18b_1e.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18b_1e.C
deleted file mode 100644
index 7554246c0c..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18b_1e.C
+++ /dev/null
@@ -1,3288 +0,0 @@
-/* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18a.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2015-06-26 - DE - v18a_mcbm - 2 layers of 2x2 module type 3 for mCBM setup @ SIS 18
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18b";
-//const TString subVersion   = "_1h";
-const TString subVersion = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-const TString geoVersion   = "trd_" + tagVersion + subVersion;
-const TString FileNameSim  = "m" + geoVersion + ".geo.root";
-const TString FileNameGeo  = "m" + geoVersion + "_geo.root";
-const TString FileNameInfo = "m" + geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = true;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;  // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;  // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;  // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;  // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;  // false;  // true, if backpanel is included in geometry
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = true;   // support structure must be there, otherwise there are no TRDpoints in sim
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-const Double_t feb_rotation_angle =
-  45;  //0.1; // 65.; // 70.; // 0.;   // rotation around x-axis, should be < 90 degrees
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-const Int_t ShowLayer[MaxLayers] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-// 5x z-positions from 260 till 550 cm
-Double_t LayerPosition[MaxLayers] = {200.};  // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 400. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 450. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 45.0;  // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., 5.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-//const Int_t LayerArraySize[3][4] =  { { 5, 5, 9, 11 },    // for layer[1-3][i,o] below
-const Int_t LayerArraySize[3][4] = {{4, 4, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//const Int_t layer1i[5][5] = { { 0,   0,   0,  0,  0 },    // abc: a module type - b orientation (x90 deg) in odd - c even layer s
-const Int_t layer1i[4][4] = {{0, 0, 0, 0},  // abc: a module type - b orientation (x90 deg) in odd - c even layer s
-                             {0, 323, 321, 0},
-                             {0, 303, 301, 0},
-                             {0, 0, 0, 0}};
-
-//// mCBM with 3x3 arrangement
-//const Int_t layer1i[5][5] = { { 0,     0,   0,    0,  0 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//			      { 0,  123,  121,  121,  0 },
-//			      { 0,  103,  101,  101,  0 },
-//			      { 0,  103,  101,  101,  0 },
-//			      { 0,     0,   0,    0,  0 } };
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-//// number of modules: 24
-//
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {2, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {107, 105, 103, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {14, 8,  5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {77, 53, 5, 0,
-                                               0,  55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-// ultimate density - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {6,  5, 6, 4,
-                                             12, 8, 4, 3};  // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-const Int_t AsicsPerFeb[NofModuleTypes]   = {315, 210, 105, 105, 108,
-                                           108, 108, 108};  //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.2;  // 2 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // asic_thickness; // 2.5 mm
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-//const Double_t asic_distance  = 0.4;  // 0.40; // a factor of width for ASIC pairs
-Double_t asic_distance;  //  = 0.40; // for 10 ASICs - a factor of width for ASIC pairs
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-//const Double_t radiator_thickness     =  35.0;    // 35 cm thickness of radiator
-const Double_t radiator_thickness = 30.0;  // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position  = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// readout boards
-const Double_t febvol_thickness = 10.0;  // 10 cm length of FEBs
-const Double_t febvol_position  = carbon_position + carbon_thickness / 2. + febvol_thickness / 2.;
-const Double_t feb_thickness    = 0.25;  // light //  2.5 mm thickness of FEBs
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18b_1e()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) {
-    //    create_xtru_supports();
-    create_box_supports();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  //  top->Export(FileNameSim);   // an alternative way of writing the top volume
-
-  TFile* outfile = new TFile(FileNameSim, "RECREATE");
-  top->Write();  // use this as input to simulations (run_sim.C)
-  outfile->Close();
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // numer of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.75, 2.50, 2.75},                                          // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},                                          // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},                                          // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 4, 8},                                              // module type 2
-     {1, 10, 1},                                             // module type 3
-     {2, 4, 2},                                              // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on Module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("module%d_frame1", moduleType), trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("trd1mod%dframe1", moduleType), trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("module%d_frame2", moduleType), trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("trd1mod%dframe2", moduleType), trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * febvol_thickness /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * febvol_thickness /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -febvol_thickness / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         febvol_thickness / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("", activeAreaX / 2., feb_thickness / 2.,
-                                     febvol_thickness / 2.);        // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    Double_t asic_pos;
-    Double_t asic_pos_x;
-    TGeoTranslation* trd_asic_trans1;  // center to corner
-
-    if (IncludeAsics) {
-      TGeoHMatrix* incline_asic;
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos   = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      feb_pos_y = feb_pos * activeAreaY;
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_size_y    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);  //, "" ); // incline_feb);
-
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = 2;
-      Int_t nofGbtxY = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-
-        gbtx_pos = (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_y = -gbtx_pos * rob_size_y;
-
-        if (iGbtxY > 0)
-          for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-            gbtx_pos =
-              (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_x = gbtx_pos * rob_size_x;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_x = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        trd_rob_y_position =
-          new TGeoTranslation("", 0., rob_pos_y,
-                              febvol_thickness / 2. - rob_thickness);     // approximate pos at end of feb volume
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvol_trans = new TGeoTranslation("", 0., 0., febvol_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvol_trans);  // put febvol at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          // DEDE
-          // 3x3
-          // 3x3          Int_t y = -(j-2);
-          // 3x3          Int_t x =   i-2;
-          Double_t y = -(j - 1.5);
-          Double_t x = i - 1.5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Double_t y = -(j - 4);
-          Double_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  //  const Double_t AperX[3] = { 4.5*DetectorSizeX[1], 5.5*DetectorSizeX[1], 6*DetectorSizeX[1] };  // inner aperture in X of support structure for stations 1,2,3
-  //  const Double_t AperY[3] = { 3.5*DetectorSizeY[1], 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture in Y of support structure for stations 1,2,3
-  const Double_t AperX[3] = {2.5 * DetectorSizeX[0], 2.5 * DetectorSizeX[0],
-                             2.5 * DetectorSizeX[0]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {2.5 * DetectorSizeY[0], 2.5 * DetectorSizeY[0],
-                             2.5 * DetectorSizeY[0]};  // inner aperture in Y of support structure for stations 1,2,3
-
-  // platform
-  //  const Double_t AperYbot[3] = { BeamHeight-(PlatformHeight+PlatformOffset+I_height), 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture for station1
-  const Double_t AperYbot[3] = {2.5 * DetectorSizeY[0], 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  //  PilPosZ[1] = LayerPosition[3] - I_width/2. + LayerThickness;
-  PilPosZ[1] = LayerPosition[1] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-  /*
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-//      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-      //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-      trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-
-      //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-//      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-//      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( zBarPosYbot[0] + zBarPosYtop[0] )/2. );  // top	  
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( zBarPosYbot[0] + zBarPosYtop[0] )/2. );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[0];
-    
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[0], rotzx01);
-      trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[0], rotzx01);
-      trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[1], rotzx02);
-      trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[1], rotzx02);
-      trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-    }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);
-      trd_I_vert2->SetLineColor(kGreen);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight + (AperY[1]+I_height) - I_width) /2.);          // top
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight - (AperY[1]+I_height) )/2. + zBarPosYbot[1] );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[1];
-    
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[2], rotzx01);
-      trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[2], rotzx01);
-      trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[3], rotzx02);
-      trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[3], rotzx02);
-      trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-    }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);
-      trd_I_vert2->SetLineColor(kGreen);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight + (AperY[2]+I_height) - I_width) /2.);          // top
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight - (AperY[2]+I_height) )/2. + zBarPosYbot[2] );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[2];
-      
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[4], rotzx01);
-      trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[4], rotzx01);
-      trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[5], rotzx02);
-      trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[5], rotzx02);
-      trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-    }
-*/
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-  /*
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[0]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[0]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);  // Yellow);
-      trd_I_hori2->SetLineColor(kRed);  // Yellow);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[0]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[0], PilPosZ[0], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[0], PilPosZ[1], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-    }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[1]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[1]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);
-      trd_I_hori2->SetLineColor(kRed);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[1]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-    
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[1], PilPosZ[2], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[1], PilPosZ[3], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-    }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[2]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[2]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);
-      trd_I_hori2->SetLineColor(kRed);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[2]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);	            
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[2], PilPosZ[4], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);	            
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);	            
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[2], PilPosZ[5], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-    }
-
-*/
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    //      TGeoCombiTrans* trd_I_slope_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), zBarPosYtop[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    //      TGeoCombiTrans* trd_I_slope_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), zBarPosYtop[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    //      TGeoCombiTrans* trd_I_slope_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.),-zBarPosYbot[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    //      TGeoCombiTrans* trd_I_slope_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.),-zBarPosYbot[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-    TGeoCombiTrans* trd_I_slope_combi03 = new TGeoCombiTrans((DetectorSizeX[0] / 2. + I_height / 2.), -zBarPosYbot[0],
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 = new TGeoCombiTrans(-(DetectorSizeX[0] / 2. + I_height / 2.), -zBarPosYbot[0],
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18c_1e.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18c_1e.C
deleted file mode 100644
index cac442f7cf..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18c_1e.C
+++ /dev/null
@@ -1,3296 +0,0 @@
-/* Copyright (C) 2016-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18a.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2015-06-26 - DE - v18a_mcbm - 2 layers of 2x2 module type 3 for mCBM setup @ SIS 18
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18c";
-//const TString subVersion   = "_1h";
-const TString subVersion = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-const TString geoVersion   = "trd_" + tagVersion + subVersion;
-const TString FileNameSim  = "m" + geoVersion + ".geo.root";
-const TString FileNameGeo  = "m" + geoVersion + "_geo.root";
-const TString FileNameInfo = "m" + geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;  // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;  // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;  // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;  // false;  // true, if backpanel is included in geometry
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // support structure must be there, otherwise there are no TRDpoints in sim
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-const Double_t feb_rotation_angle =
-  45;  //0.1; // 65.; // 70.; // 0.;   // rotation around x-axis, should be < 90 degrees
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-const Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-// 5x z-positions from 260 till 550 cm
-Double_t LayerPosition[MaxLayers] = {120.};  // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 170. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 200. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 400. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 450. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-const Double_t LayerThickness = 15.0;  // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., 5.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-//const Int_t LayerArraySize[3][4] =  { { 5, 5, 9, 11 },    // for layer[1-3][i,o] below
-const Int_t LayerArraySize[3][4] = {{4, 4, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//// mCBM with 2x2 arrangement
-const Int_t layer1i[4][4] = {{0, 0, 0, 0},  // abc: a module type - b orientation (x90 deg) in odd - c even layer s
-                             {0, 0, 0, 0},
-                             {0, 0, 0, 0},
-                             //                              { 0, 323, 321,  0 },
-                             //                              { 0, 303, 301,  0 },
-                             {0, 0, 0, 0}};
-
-//// mCBM with 3x3 arrangement
-//const Int_t layer1i[5][5] = { { 0,  0,   0,   0,  0 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//			      { 0,  0,   0,   0,  0 },
-//			      { 0,  0,  101,  0,  0 },
-//			      { 0,  0,   0,   0,  0 },
-//			      { 0,  0,   0,   0,  0 } };
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-//// number of modules: 24
-//
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {2, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {107, 105, 103, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {14, 8,  5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {77, 53, 5, 0,
-                                               0,  55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-// ultimate density - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {6,  5, 6, 4,
-                                             12, 8, 4, 3};  // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-const Int_t AsicsPerFeb[NofModuleTypes]   = {315, 210, 105, 105, 108,
-                                           108, 108, 108};  //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.2;  // 2 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // asic_thickness; // 2.5 mm
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-//const Double_t asic_distance  = 0.4;  // 0.40; // a factor of width for ASIC pairs
-Double_t asic_distance;  //  = 0.40; // for 10 ASICs - a factor of width for ASIC pairs
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // no radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// readout boards
-const Double_t febvol_thickness = 10.0;  // 10 cm length of FEBs
-const Double_t febvol_position  = carbon_position + carbon_thickness / 2. + febvol_thickness / 2.;
-const Double_t feb_thickness    = 0.25;  // light //  2.5 mm thickness of FEBs
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18c_1e()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) {
-    //    create_xtru_supports();
-    create_box_supports();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  //  top->Export(FileNameSim);   // an alternative way of writing the top volume
-
-  TFile* outfile = new TFile(FileNameSim, "RECREATE");
-  top->Write();  // use this as input to simulations (run_sim.C)
-  outfile->Close();
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // numer of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.75, 2.50, 2.75},                                          // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},                                          // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},                                          // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 4, 8},                                              // module type 2
-     {1, 10, 1},                                             // module type 3
-     {2, 4, 2},                                              // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on Module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("module%d_frame1", moduleType), trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("trd1mod%dframe1", moduleType), trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("module%d_frame2", moduleType), trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("trd1mod%dframe2", moduleType), trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * febvol_thickness /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * febvol_thickness /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -febvol_thickness / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         febvol_thickness / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("", activeAreaX / 2., feb_thickness / 2.,
-                                     febvol_thickness / 2.);        // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    Double_t asic_pos;
-    Double_t asic_pos_x;
-    TGeoTranslation* trd_asic_trans1;  // center to corner
-
-    if (IncludeAsics) {
-      TGeoHMatrix* incline_asic;
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos   = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      feb_pos_y = feb_pos * activeAreaY;
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_size_y    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);  //, "" ); // incline_feb);
-
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = 2;
-      Int_t nofGbtxY = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-
-        gbtx_pos = (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_y = -gbtx_pos * rob_size_y;
-
-        if (iGbtxY > 0)
-          for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-            gbtx_pos =
-              (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_x = gbtx_pos * rob_size_x;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_x = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        trd_rob_y_position =
-          new TGeoTranslation("", 0., rob_pos_y,
-                              febvol_thickness / 2. - rob_thickness);     // approximate pos at end of feb volume
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvol_trans = new TGeoTranslation("", 0., 0., febvol_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvol_trans);  // put febvol at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          // 3x3
-          //          Double_t y = -(j-3);
-          //          Double_t x =   i;
-          //          cout << "YY " << j << " " << y << endl;
-          //          cout << "XX " << i << " " << x << endl;
-          // 2x2
-          Double_t y = -(j - 1.5);
-          Double_t x = i - 1.5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Double_t y = -(j - 4);
-          Double_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  //  const Double_t AperX[3] = { 4.5*DetectorSizeX[1], 5.5*DetectorSizeX[1], 6*DetectorSizeX[1] };  // inner aperture in X of support structure for stations 1,2,3
-  //  const Double_t AperY[3] = { 3.5*DetectorSizeY[1], 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture in Y of support structure for stations 1,2,3
-  const Double_t AperX[3] = {2.5 * DetectorSizeX[0], 2.5 * DetectorSizeX[0],
-                             2.5 * DetectorSizeX[0]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {2.5 * DetectorSizeY[0], 2.5 * DetectorSizeY[0],
-                             2.5 * DetectorSizeY[0]};  // inner aperture in Y of support structure for stations 1,2,3
-
-  // platform
-  //  const Double_t AperYbot[3] = { BeamHeight-(PlatformHeight+PlatformOffset+I_height), 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture for station1
-  const Double_t AperYbot[3] = {2.5 * DetectorSizeY[0], 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  //  PilPosZ[0] = LayerPosition[0] + I_width/2.;
-  //  PilPosZ[1] = LayerPosition[3] - I_width/2. + LayerThickness;
-  PilPosZ[0] = LayerPosition[0];
-  PilPosZ[1] = LayerPosition[3];
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-  /*
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-//      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-      //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-      trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-
-      //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-//      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-//      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( zBarPosYbot[0] + zBarPosYtop[0] )/2. );  // top	  
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( zBarPosYbot[0] + zBarPosYtop[0] )/2. );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[0];
-    
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[0], rotzx01);
-      trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[0], rotzx01);
-      trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[1], rotzx02);
-      trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[1], rotzx02);
-      trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-    }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);
-      trd_I_vert2->SetLineColor(kGreen);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight + (AperY[1]+I_height) - I_width) /2.);          // top
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight - (AperY[1]+I_height) )/2. + zBarPosYbot[1] );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[1];
-    
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[2], rotzx01);
-      trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[2], rotzx01);
-      trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[3], rotzx02);
-      trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[3], rotzx02);
-      trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-    }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);
-      trd_I_vert2->SetLineColor(kGreen);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight + (AperY[2]+I_height) - I_width) /2.);          // top
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight - (AperY[2]+I_height) )/2. + zBarPosYbot[2] );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[2];
-      
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[4], rotzx01);
-      trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[4], rotzx01);
-      trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[5], rotzx02);
-      trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[5], rotzx02);
-      trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-    }
-*/
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-  /*
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[0]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[0]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);  // Yellow);
-      trd_I_hori2->SetLineColor(kRed);  // Yellow);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[0]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[0], PilPosZ[0], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[0], PilPosZ[1], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-    }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[1]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[1]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);
-      trd_I_hori2->SetLineColor(kRed);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[1]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-    
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[1], PilPosZ[2], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[1], PilPosZ[3], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-    }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[2]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[2]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);
-      trd_I_hori2->SetLineColor(kRed);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[2]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);	            
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[2], PilPosZ[4], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);	            
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);	            
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[2], PilPosZ[5], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-    }
-
-*/
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    //      TGeoCombiTrans* trd_I_slope_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), zBarPosYtop[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    //      TGeoCombiTrans* trd_I_slope_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), zBarPosYtop[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    //      TGeoCombiTrans* trd_I_slope_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.),-zBarPosYbot[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    //      TGeoCombiTrans* trd_I_slope_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.),-zBarPosYbot[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-    TGeoCombiTrans* trd_I_slope_combi03 = new TGeoCombiTrans((DetectorSizeX[0] / 2. + I_height / 2.), -zBarPosYbot[0],
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 = new TGeoCombiTrans(-(DetectorSizeX[0] / 2. + I_height / 2.), -zBarPosYbot[0],
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18d_1e.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18d_1e.C
deleted file mode 100644
index 0bda8ee845..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18d_1e.C
+++ /dev/null
@@ -1,3299 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18a.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-03-17 - DE - v18d_mcbm - extend layer pitch to 25 cm (SPS 2016 setup, w/o radiators)
-// 2015-06-26 - DE - v18a_mcbm - 2 layers of 2x2 module type 3 for mCBM setup @ SIS 18
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18d";
-//const TString subVersion   = "_1h";
-const TString subVersion = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-const TString geoVersion   = "trd_" + tagVersion + subVersion;
-const TString FileNameSim  = "m" + geoVersion + ".geo.root";
-const TString FileNameGeo  = "m" + geoVersion + "_geo.root";
-const TString FileNameInfo = "m" + geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;  // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;  // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;  // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;  // false;  // true, if backpanel is included in geometry
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // support structure must be there, otherwise there are no TRDpoints in sim
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-const Double_t feb_rotation_angle =
-  45;  //0.1; // 65.; // 70.; // 0.;   // rotation around x-axis, should be < 90 degrees
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-const Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-// 5x z-positions from 260 till 550 cm
-Double_t LayerPosition[MaxLayers] = {110.};  // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 120. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 170. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 200. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 400. }; // start position - 2015-07-03 - DE - v18 - mCBM @ SIS 18
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 450. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 15.0; // Thickness of one TRD layer in cm
-const Double_t LayerThickness = 25.0;  // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., 5.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-//const Int_t LayerArraySize[3][4] =  { { 5, 5, 9, 11 },    // for layer[1-3][i,o] below
-const Int_t LayerArraySize[3][4] = {{4, 4, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//// mCBM with 2x2 arrangement
-const Int_t layer1i[4][4] = {{0, 0, 0, 0},  // abc: a module type - b orientation (x90 deg) in odd - c even layer s
-                             {0, 0, 0, 0},
-                             {0, 0, 0, 0},
-                             //                              { 0, 323, 321,  0 },
-                             //                              { 0, 303, 301,  0 },
-                             {0, 0, 0, 0}};
-
-//// mCBM with 3x3 arrangement
-//const Int_t layer1i[5][5] = { { 0,  0,   0,   0,  0 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//			      { 0,  0,   0,   0,  0 },
-//			      { 0,  0,  101,  0,  0 },
-//			      { 0,  0,   0,   0,  0 },
-//			      { 0,  0,   0,   0,  0 } };
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// ### Layer Type 1
-//// v14x - module types in the inner sector of layer type 1 - looking upstream
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-//// number of modules: 24
-//
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {2, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {107, 105, 103, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {14, 8,  5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {77, 53, 5, 0,
-                                               0,  55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-// ultimate density - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {6,  5, 6, 4,
-                                             12, 8, 4, 3};  // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-const Int_t AsicsPerFeb[NofModuleTypes]   = {315, 210, 105, 105, 108,
-                                           108, 108, 108};  //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.2;  // 2 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // asic_thickness; // 2.5 mm
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-//const Double_t asic_distance  = 0.4;  // 0.40; // a factor of width for ASIC pairs
-Double_t asic_distance;  //  = 0.40; // for 10 ASICs - a factor of width for ASIC pairs
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // no radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// readout boards
-const Double_t febvol_thickness = 10.0;  // 10 cm length of FEBs
-const Double_t febvol_position  = carbon_position + carbon_thickness / 2. + febvol_thickness / 2.;
-const Double_t feb_thickness    = 0.25;  // light //  2.5 mm thickness of FEBs
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18d_1e()
-{
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) {
-    //    create_xtru_supports();
-    create_box_supports();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  //  top->Export(FileNameSim);   // an alternative way of writing the top volume
-
-  TFile* outfile = new TFile(FileNameSim, "RECREATE");
-  top->Write();  // use this as input to simulations (run_sim.C)
-  outfile->Close();
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // numer of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.75, 2.50, 2.75},                                          // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},                                          // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},                                          // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 4, 8},                                              // module type 2
-     {1, 10, 1},                                             // module type 3
-     {2, 4, 2},                                              // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on Module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString geoFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(geoFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi = new TGeoBBox("", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo = new TGeoBBox("", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                                                   lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb =
-        new TGeoBBox("", lattice_i_width[type] / 2., 0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                     lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("module%d_frame1", moduleType), trd_frame1, frameVolMed);
-    //   TGeoVolume* trdmod1_frame1vol = new TGeoVolume(Form("trd1mod%dframe1", moduleType), trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("module%d_frame2", moduleType), trd_frame2, frameVolMed);
-    //   TGeoVolume* trdmod1_frame2vol = new TGeoVolume(Form("trd1mod%dframe2", moduleType), trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * febvol_thickness /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * febvol_thickness /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -febvol_thickness / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         febvol_thickness / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("", activeAreaX / 2., feb_thickness / 2.,
-                                     febvol_thickness / 2.);        // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    Double_t asic_pos;
-    Double_t asic_pos_x;
-    TGeoTranslation* trd_asic_trans1;  // center to corner
-
-    if (IncludeAsics) {
-      TGeoHMatrix* incline_asic;
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans1 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos   = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      feb_pos_y = feb_pos * activeAreaY;
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_size_y    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);  //, "" ); // incline_feb);
-
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = 2;
-      Int_t nofGbtxY = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-
-        gbtx_pos = (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_y = -gbtx_pos * rob_size_y;
-
-        if (iGbtxY > 0)
-          for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-            gbtx_pos =
-              (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_x = gbtx_pos * rob_size_x;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_x = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        trd_rob_y_position =
-          new TGeoTranslation("", 0., rob_pos_y,
-                              febvol_thickness / 2. - rob_thickness);     // approximate pos at end of feb volume
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvol_trans = new TGeoTranslation("", 0., 0., febvol_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvol_trans);  // put febvol at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          // 3x3
-          //          Double_t y = -(j-3);
-          //          Double_t x =   i;
-          //          cout << "YY " << j << " " << y << endl;
-          //          cout << "XX " << i << " " << x << endl;
-          // 2x2
-          Double_t y = -(j - 1.5);
-          Double_t x = i - 1.5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Double_t y = -(j - 4);
-          Double_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  //  const Double_t AperX[3] = { 4.5*DetectorSizeX[1], 5.5*DetectorSizeX[1], 6*DetectorSizeX[1] };  // inner aperture in X of support structure for stations 1,2,3
-  //  const Double_t AperY[3] = { 3.5*DetectorSizeY[1], 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture in Y of support structure for stations 1,2,3
-  const Double_t AperX[3] = {2.5 * DetectorSizeX[0], 2.5 * DetectorSizeX[0],
-                             2.5 * DetectorSizeX[0]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {2.5 * DetectorSizeY[0], 2.5 * DetectorSizeY[0],
-                             2.5 * DetectorSizeY[0]};  // inner aperture in Y of support structure for stations 1,2,3
-
-  // platform
-  //  const Double_t AperYbot[3] = { BeamHeight-(PlatformHeight+PlatformOffset+I_height), 4.5*DetectorSizeY[1], 5*DetectorSizeY[1] };  // inner aperture for station1
-  const Double_t AperYbot[3] = {2.5 * DetectorSizeY[0], 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  //  PilPosZ[0] = LayerPosition[0] + I_width/2.;
-  //  PilPosZ[1] = LayerPosition[3] - I_width/2. + LayerThickness;
-  PilPosZ[0] = LayerPosition[0];
-  PilPosZ[1] = LayerPosition[3];
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-  /*
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-//      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-      //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-      trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-
-      //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., ( (AperYbot[0]+I_height) + (AperY[0]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-//      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-//      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( zBarPosYbot[0] + zBarPosYtop[0] )/2. );  // top	  
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( zBarPosYbot[0] + zBarPosYtop[0] )/2. );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[0];
-    
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[0], rotzx01);
-      trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[0], rotzx01);
-      trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[1], rotzx02);
-      trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -( (AperYbot[0]+I_height) - (AperY[0]+I_height))/2., PilPosZ[1], rotzx02);
-      trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-    }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);
-      trd_I_vert2->SetLineColor(kGreen);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[1]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight + (AperY[1]+I_height) - I_width) /2.);          // top
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight - (AperY[1]+I_height) )/2. + zBarPosYbot[1] );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[1];
-    
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[2], rotzx01);
-      trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[2], rotzx01);
-      trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[3], rotzx02);
-      trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[1]+I_height))/2., PilPosZ[3], rotzx02);
-      trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-    }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert1     = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert2     = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-      trd_I_vert1->SetLineColor(kGreen);
-      trd_I_vert2->SetLineColor(kGreen);
-    
-      TGeoTranslation *ty01 = new TGeoTranslation("ty01", 0.,                      0., 0.);
-      TGeoTranslation *ty02 = new TGeoTranslation("ty02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *ty03 = new TGeoTranslation("ty03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[2]+I_height) ) /2.);
-      TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-      // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_vert_vol1->SetLineColor(kGreen);
-
-      // build I-bar trd_I_vert_vol1
-      trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-      trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-      // close gap to horizontal z-bars
-      TGeoBBox* trd_I_vert3_keep  = new TGeoBBox("", (I_width-I_thick)/2. /2., I_height /2. - I_thick, I_thick /2.);
-      TGeoVolume* trd_I_vert3     = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-      trd_I_vert3->SetLineColor(kGreen);
-      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight + (AperY[2]+I_height) - I_width) /2.);          // top
-      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -(BeamHeight - (AperY[2]+I_height) )/2. + zBarPosYbot[2] );  // bottom
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-      trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-      PilPosX = AperX[2];
-      
-      TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[4], rotzx01);
-      trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-      TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[4], rotzx01);
-      trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-      TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[5], rotzx02);
-      trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-      TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.), -(BeamHeight - (AperY[2]+I_height))/2., PilPosZ[5], rotzx02);
-      trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-    }
-*/
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-  /*
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[0]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[0]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);  // Yellow);
-      trd_I_hori2->SetLineColor(kRed);  // Yellow);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[0]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[0], PilPosZ[0], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[0], PilPosZ[1], roty090);
-      trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-    }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[1]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[1]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);
-      trd_I_hori2->SetLineColor(kRed);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[1]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-    
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[1], PilPosZ[2], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[1], PilPosZ[3], roty090);
-      trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-    }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      TGeoBBox* trd_I_hori1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, AperX[2]);
-      TGeoVolume* trd_I_hori1     = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-      TGeoBBox* trd_I_hori2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., AperX[2]);
-      TGeoVolume* trd_I_hori2     = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-      trd_I_hori1->SetLineColor(kRed);
-      trd_I_hori2->SetLineColor(kRed);
-    
-      TGeoTranslation *tx01 = new TGeoTranslation("tx01", 0.,                      0., 0.);
-      TGeoTranslation *tx02 = new TGeoTranslation("tx02", 0.,  (I_height-I_thick) /2., 0.);
-      TGeoTranslation *tx03 = new TGeoTranslation("tx03", 0., -(I_height-I_thick) /2., 0.);
-    
-      TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., AperX[2]);
-      TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-      // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-      trd_I_hori_vol1->SetLineColor(kRed);
-
-      // build I-bar trd_I_hori_vol1
-      trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-      trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-      TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);	            
-      TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0.,-xBarPosYbot[2], PilPosZ[4], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);	            
-      TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);	            
-      TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0.,-xBarPosYbot[2], PilPosZ[5], roty090);
-      trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-    }
-
-*/
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    //      TGeoCombiTrans* trd_I_slope_combi01 = new TGeoCombiTrans( (PilPosX+I_height/2.), zBarPosYtop[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    //      TGeoCombiTrans* trd_I_slope_combi02 = new TGeoCombiTrans(-(PilPosX+I_height/2.), zBarPosYtop[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    //      TGeoCombiTrans* trd_I_slope_combi03 = new TGeoCombiTrans( (PilPosX+I_height/2.),-zBarPosYbot[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    //      TGeoCombiTrans* trd_I_slope_combi04 = new TGeoCombiTrans(-(PilPosX+I_height/2.),-zBarPosYbot[0], (PilPosZ[0]+PilPosZ[1])/2., rotz090);
-    //      trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-    TGeoCombiTrans* trd_I_slope_combi03 = new TGeoCombiTrans((DetectorSizeX[0] / 2. + I_height / 2.), -zBarPosYbot[0],
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 = new TGeoCombiTrans(-(DetectorSizeX[0] / 2. + I_height / 2.), -zBarPosYbot[0],
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep =
-      new TGeoBBox("", I_thick / 2., I_height / 2. - I_thick, (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1 = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18e.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18e.C
deleted file mode 100644
index da41963c09..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18e.C
+++ /dev/null
@@ -1,3729 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18e.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18e";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 115., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., 5.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 80, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 0,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 4, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 105, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-//void Create_TRD_Geometry_v18e(const Int_t setupid = 1) {
-void Create_TRD_Geometry_v18e()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // number of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},  // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},  // module type 3
-     {2, 4, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18f.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18f.C
deleted file mode 100644
index c9d9a9b75e..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18f.C
+++ /dev/null
@@ -1,3699 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18f.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-05-03 - DE - v18f    - rotate the mTRD about 20 degrees around the target position
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18f";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 110., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., 5.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 80, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 0,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 4, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 105, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-//void Create_TRD_Geometry_v18f(const Int_t setupid = 1) {
-void Create_TRD_Geometry_v18f()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -10., 0., zfront[setupid]);
-
-  // rotate the TRD around y
-  TGeoRotation* trd_rotation = new TGeoRotation();
-  trd_rotation->RotateY(-20);
-  TGeoCombiTrans* trd_placement =
-    new TGeoCombiTrans(sin(-20 / 180. * acos(-1)) * zfront[setupid], 0., zfront[setupid], trd_rotation);
-  //  TGeoCombiTrans* trd_placement = new TGeoCombiTrans(0., 0., 0, trd_rotation);
-
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // number of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},  // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},  // module type 3
-     {2, 4, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18g.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18g.C
deleted file mode 100644
index 926c6b6fc6..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18g.C
+++ /dev/null
@@ -1,3730 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18g.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-11-03 - DE - v18g    - shift mTRD to z=140 cm for acceptance matching with mSTS
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18g";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 140., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // false;  // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // false;  // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-3] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90°
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90°
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90°
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., 5.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-const Int_t layer2i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-const Int_t layer2o[9][11] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-                              {0, 823, 823, 823, 823, 821, 821, 821, 821, 821, 0},
-                              {0, 823, 823, 823, 723, 721, 721, 821, 821, 821, 0},
-                              {0, 823, 723, 623, 0, 0, 0, 621, 721, 821, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 703, 603, 0, 0, 0, 601, 701, 801, 0},
-                              {0, 803, 803, 803, 703, 701, 701, 801, 801, 801, 0},
-                              {0, 803, 803, 803, 803, 801, 801, 801, 801, 801, 0},
-                              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 0, 1, 1, 1, 1};  // 0 = small module, 1 = large module
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 80, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 1, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 0,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 0,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 4, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 105, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[2] = {1.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[2] = {57., 95.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[2] = {57., 95.};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-//void Create_TRD_Geometry_v18g(const Int_t setupid = 1) {
-void Create_TRD_Geometry_v18g()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = create_trd_module_type(moduleType);
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[2] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[2]   = {80, 128};  // number of pads in rows
-  Int_t nrow                    = 0;          // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},  // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},  // module type 3
-     {2, 4, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    if (ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] < 5)
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1],
-                PlaneId[iLayer]);
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      channels_per_feb[iModule]    = 80 * 4;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(2.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer < 4) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 4) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id               = 0;
-  Int_t layerType               = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated               = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18h.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18h.C
deleted file mode 100644
index 4a4c85c8d6..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18h.C
+++ /dev/null
@@ -1,4062 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18h.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-05-05 - DE - v18h    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-05 - DE - v18g    - shift TRD downstream by 5 cm to avoid overlap with 25 degree beampipe
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18h";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 100., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 10, 11, 10, 11, 20,
-                                    21, 20, 21, 30};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., -10., 0., 0., 0.,
-                                         0., 0.,   0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57, 95., 59};     // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 58.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18h()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          // DE          if (layerId == 0)
-          // DE          {
-          // DE             xPos += -4;   // shift first module to the right
-          // DE             cout << "DE shifted" << endl;
-          // DE          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18i.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18i.C
deleted file mode 100644
index b8faaf0c2b..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18i.C
+++ /dev/null
@@ -1,4094 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18i.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18i";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 100., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 10, 11, 10, 11, 20,
-                                    21, 20, 21, 30};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., -10., 0., 0., 0.,
-                                         0., 0.,   0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57, 95., 59};     // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 58.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18i()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18j.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18j.C
deleted file mode 100644
index affef98544..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18j.C
+++ /dev/null
@@ -1,4100 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18j.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18j";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 100., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 10, 11, 10, 11, 20,
-                                    21, 20, 21, 30};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., -10., 0., 0., 0.,
-                                         0., 0.,   0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57, 95., 59};     // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 58.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18j()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          //          frameref_angle = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness) );
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 15 + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          //          layer_angle    = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness) );
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 15 + (layerId - 1) * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          //	  xPos = tan( frameref_angle ) * (zfront[setupid] + 15 + (layerId - 1) * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = tan(frameref_angle) * (zfront[setupid] + 15 + (layerId - 1) * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //	  xPos -= tan( frameref_angle ) * 15.;
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos)
-                             / (zfront[setupid] + 15 + (layerId - 1) * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18k.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18k.C
deleted file mode 100644
index 342525fcea..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18k.C
+++ /dev/null
@@ -1,4101 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18k.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18k";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 115., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -115.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57, 95., 59};     // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 58.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18k()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18l.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18l.C
deleted file mode 100644
index 0308645274..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18l.C
+++ /dev/null
@@ -1,4104 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18l.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18l";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5]  = {260., 140., 360., 410., 550.};
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 25.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -115.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57, 95., 59};     // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 58.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18l()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18m.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18m.C
deleted file mode 100644
index 21c9dbc021..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18m.C
+++ /dev/null
@@ -1,4109 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18m.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18m";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 149., 360., 410., 550.};
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 9;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 0, 1, 1, 1, 1, 2};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 90, 80, 90, 90, 90, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 6};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes] = {105, 105, 105, 103, 107, 105, 105, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 18};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 18};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 410};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57, 95., 59};     // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18m()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},  // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     {2.79, 2.79, 2.79}};    // module type 9 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},  // module type 3
-     {2, 4, 2},  // module type 4
-
-     {8, 8, 8},    // module type 5
-     {4, 8, 4},    // module type 6
-     {2, 4, 2},    // module type 7
-     {2, 2, 2},    // module type 8
-     {2, 16, 2}};  // module type 9
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 8
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 8;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType], nofFebsHalf(nofFebs / 2);
-    printf("AB : nofFebs[%d] nofFebsHalf[%d]\n", nofFebs, nofFebsHalf);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18n.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18n.C
deleted file mode 100644
index 05587f9441..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18n.C
+++ /dev/null
@@ -1,4109 +0,0 @@
-/* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18n.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18n";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 149., 360., 410., 550.};
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57., 95., 59.0};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18n()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18o.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18o.C
deleted file mode 100644
index 03deaf8cd1..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18o.C
+++ /dev/null
@@ -1,4119 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18o.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2018-02-27 - DE - v18o    - apply a hack to remap the layer ids for tracking 5,1,2,3,4 -> 1,2,3,4,5
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18o_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 149., 360., 410., 550.};
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  // + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 9;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 0, 1, 1, 1, 1, 2};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 90, 80, 90, 90, 90, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 6};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes] = {105, 105, 105, 103, 107, 105, 105, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 18};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 18};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 410};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57, 95., 59};     // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18o()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     {6.75, 6.75, 6.75},  // module type 4 -  4.56 mm2
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     {2.79, 2.79, 2.79}};    // module type 9 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},  // module type 3
-     {2, 4, 2},  // module type 4
-
-     {8, 8, 8},    // module type 5
-     {4, 8, 4},    // module type 6
-     {2, 4, 2},    // module type 7
-     {2, 2, 2},    // module type 8
-     {2, 16, 2}};  // module type 9
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 8
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 8;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType], nofFebsHalf(nofFebs / 2);
-    printf("AB : nofFebs[%d] nofFebsHalf[%d]\n", nofFebs, nofFebsHalf);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // ugly hack for Redmine Issue #1046
-          if (copy == 201005001) copy = 201001001;  // remap layer id for tracking
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // ugly hack for Redmine Issue #1046
-          if (copy == 101201001) copy = 101202001;  // remap layer id for tracking
-          if (copy == 101102001) copy = 101103001;  // remap layer id for tracking
-          if (copy == 101203001) copy = 101204001;  // remap layer id for tracking
-          if (copy == 101104001) copy = 101105001;  // remap layer id for tracking
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18p.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18p.C
deleted file mode 100644
index 28c2966a0d..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18p.C
+++ /dev/null
@@ -1,4120 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18p.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2018-03-16 - DE - v18p    - single mTD module for TOF cosmics setup in Heidelberg
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18p";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-//const Double_t zfront[5]  = { 260., 149., 360., 410., 550. };
-const Double_t zfront[5] = {260., 964., 360., 410., 550.};
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-//Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l is default
-Int_t ShowLayer[MaxLayers] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-// const Int_t   LayerType[MaxLayers]        = {10, 11, 10, 11, 20, 21, 20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-const Int_t LayerType[MaxLayers] = {11, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-//Double_t LayerPosition[MaxLayers] = { 0. }; // start position = 0 - 2016-07-12 - DE
-Double_t LayerPosition[MaxLayers] = {-19.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 103, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  //                              {  0,    0,    0,    0,    0,  821,    0,    0,    0,    0,    0 },
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {1, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {103, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {3, 10, 5, 18,
-                                             0, 10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {3, 55, 5, 333333,
-                                               0, 55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {7, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {105, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.0, 1.0, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {59., 94., 59.0};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {59., 94., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-//const Double_t lattice_o_width[2] = { 1.5, 1.5 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.0, 1.0};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18p()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{4.50, 1.50, 4.50},                                          // module type 1
-     {4.50, 1.50, 4.50},                                          // module type 2
-     {4.50, 1.50, 4.50},                                          // module type 3
-     {4.50, 1.50, 4.50},                                          // module type 4
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{6, 2, 6},                                              // module type 1
-     {6, 2, 6},                                              // module type 2
-     {6, 2, 6},                                              // module type 3
-     {6, 2, 6},                                              // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          module_rotation->RotateX(180);
-          xPos = -(1.5 + 4.5 * 3);  // center 2nd row on top of TOF RPC center
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          //	  xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18q.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18q.C
deleted file mode 100644
index 1dae875aa9..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18q.C
+++ /dev/null
@@ -1,4110 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18q.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18q_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 149., 360., 410., 550.};
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57., 95., 59.0};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18q()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          xPos = tan(frameref_angle) * (zfront[setupid] + layerId * LayerThickness)
-                 - (DetectorSizeX[1] / 2. - FrameWidth[1]);  // shift module along x-axis
-                                                             //        xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18r.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18r.C
deleted file mode 100644
index 13b36ffa78..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v18r.C
+++ /dev/null
@@ -1,4110 +0,0 @@
-/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer] */
-
-///
-/// \file Create_TRD_Geometry_v18r.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2018-09-06 - DE - v18r    - position 2 TRD modules on z axis with 26 cm pitch for cosmic setup 2018
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v18r_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 244., 360., 410., 550.};
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 26.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57., 95., 59.0};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium   = "air";
-const TString RadiatorVolumeMedium  = "TRDpefoam20";
-const TString LatticeVolumeMedium   = "TRDG10";
-const TString KaptonVolumeMedium    = "TRDkapton";
-const TString GasVolumeMedium       = "TRDgas";
-const TString PadCopperVolumeMedium = "TRDcopper";
-const TString PadPcbVolumeMedium    = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium = "TRDaramide";
-const TString CarbonVolumeMedium    = "TRDcarbon";
-const TString FebVolumeMedium       = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium      = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium      = "air";     // leave as air
-const TString FrameVolumeMedium     = "TRDG10";
-const TString PowerBusVolumeMedium  = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium  = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium = "aluminium";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v18r()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  //  gGeoMan->CheckOverlaps(0.001);
-  //  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-
-          //	  xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;  // do not shift in x for cosmic setup
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v20a.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v20a.C
deleted file mode 100644
index abfe205364..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v20a.C
+++ /dev/null
@@ -1,4228 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TRD_Geometry_v20a.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v20a_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 177., 360., 410., 550.};  // move 1st TRD to z=177 cm
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57., 95., 59.0};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v20a()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v20b.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v20b.C
deleted file mode 100644
index 5ce8dce0cb..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v20b.C
+++ /dev/null
@@ -1,4229 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: Florian Uhlig [committer] */
-
-///
-/// \file Create_TRD_Geometry_v20b.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v20b_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 177., 360., 410., 550.};  // move 1st TRD to z=177 cm
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 401, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 8;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1,
-                                          1, 1, 1};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1};                  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107, 105, 105, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18,
-                                             0,  10, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333,
-                                               0,   55, 5, 3};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108,
-                                           108, 108, 108};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[3] = {1.5, 1.5, 2.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[3] = {57., 95., 59.0};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[3] = {57., 95., 60.8};  // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = carbonBu0_position + carbonBu_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trdi_module_type();
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v20b()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule == 3 ? create_trdi_module_type() : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[3] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[3]   = {80, 128, 72};  // number of pads in rows
-  Int_t nrow                    = 0;              // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},      // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},      // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},   // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25}};  // module type 8 - 11.14 mm2
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2}};  // module type 8
-  //          {   1,   2,   1 } };       // module type 8
-  //          {  10,   4,  10 },         // module type 5
-  //          {   4,   4,   4 },         // module type 6
-  //          {   2,  12,   2 },         // module type 6
-  //          {   2,   4,   2 },         // module type 7
-  //          {   2,   2,   2 } };       // module type 8
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaX[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-8])\n");
-  fprintf(ifile, "// 8 modules  // 3 sectors  // 4 values \n");
-  fprintf(ifile, "Float_t fst1_pad_type[8][3][4] =        \n");
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.1f, %5.2f, %.1f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-
-//________________________________________________________________________________________________
-TGeoVolume* create_trdi_module_type()
-{
-  Int_t lyType = 2, moduleType = 4;
-  Double_t sizeX       = DetectorSizeX[lyType];
-  Double_t sizeY       = DetectorSizeY[lyType];
-  Double_t frameWidth  = FrameWidth[lyType];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed   = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed  = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = "moduleBu";
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon = new TGeoBBox("trd_carbon", activeAreaX / 2., activeAreaY / 2., carbonBu_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("EntranceWinC", trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycombBu", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("EntranceWinHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-
-    module->AddNode(trdmod1_carbonvol, 1, new TGeoTranslation("", 0., 0., carbonBu1_position));
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu0_position));
-    module->AddNode(trdmod1_carbonvol, 2, new TGeoTranslation("", 0., 0., carbonBu0_position));
-  }
-
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  trdmod1_gasvol->SetLineColor(kWhite);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  module->AddNode(trdmod1_gasvol, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frameH", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame1vol, 1,
-                    new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frameBu_position));
-    module->AddNode(trdmod1_frame1vol, 2,
-                    new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frameBu_position));
-    // frame2
-    TGeoBBox* trd_frame2 = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frameBu_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frameV", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kBlue);
-    module->AddNode(trdmod1_frame2vol, 1,
-                    new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frameBu_position));
-    module->AddNode(trdmod1_frame2vol, 2,
-                    new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frameBu_position));
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("pads", trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_padcoppervol, 1, new TGeoTranslation("", 0., 0., padcopperBu_position));
-    // Pad Plane
-    TGeoBBox* trd_padpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padsPCB", trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_padpcbvol, 1, new TGeoTranslation("", 0., 0., padplaneBu_position));
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb =
-      new TGeoBBox("trd_honeycomb", activeAreaX / 2., activeAreaY / 2., honeycombBu_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("BackpanelHC", trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    module->AddNode(trdmod1_honeycombvol, 1, new TGeoTranslation("", 0., 0., honeycombBu1_position));
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* trd_screenpcb = new TGeoBBox("trd_padpcb", activeAreaX / 2., activeAreaY / 2., glassFibre_thickness / 2.);
-    TGeoVolume* trdmod1_screenpcbvol = new TGeoVolume("BackpanelPCB", trd_screenpcb, padpcbVolMed);
-    trdmod1_screenpcbvol->SetLineColor(kGreen);
-    module->AddNode(trdmod1_screenpcbvol, 1, new TGeoTranslation("", 0., 0., glassFibre_position));
-    // Pad Copper
-    TGeoBBox* trd_screencopper =
-      new TGeoBBox("trd_padcopper", activeAreaX / 2., activeAreaY / 2., cuCoating_thickness / 2.);
-    TGeoVolume* trdmod1_screencoppervol = new TGeoVolume("BackpanelScreen", trd_screencopper, padcopperVolMed);
-    trdmod1_screencoppervol->SetLineColor(kRed);
-    module->AddNode(trdmod1_screencoppervol, 1, new TGeoTranslation("", 0., 0., cuCoating_position));
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly("febbox");
-    TGeoTranslation* trd_feb_position;  // trnslation for positioning FEBs on TRD
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb = new TGeoBBox("trd_feb", febFASP_width / 2., activeAreaY / 4. - 0.5, febFASP_thickness / 2.);
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of PCB
-    trdmod1_feb->SetLineColor(kYellow);
-    trd_feb_box->AddNode(trdmod1_feb, 1);
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_y;
-      TGeoTranslation* trd_asic_pos;  // ASIC on FEB x position
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_fasp", 0.5 * fasp_size[0], 0.5 * fasp_size[1],
-                                        asic_thickness / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("fasp", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlack);
-
-      Int_t nofAsics = AsicsPerFeb[moduleType - 1] % 100;
-      for (Int_t iAsic(0), jAsic(1); iAsic < nofAsics; iAsic++) {
-        asic_pos   = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB
-        asic_pos_y = asic_pos * activeAreaY / 2.;
-        trd_asic_pos =
-          new TGeoTranslation("", (iAsic % 2 ? -1 : 1) * fasp_xoffset, asic_pos_y + (iAsic % 2 ? -1 : 1) * fasp_yoffset,
-                              feb_thickness / 2. + asic_thickness / 2. + asic_offset);
-        trd_feb_box->AddNode(trdmod1_asic, jAsic++, trd_asic_pos);
-      }
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_x, feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1], nofFebsHalf(nofFebs / 2);
-    Double_t zfeb_pos(febFASP_position);
-    for (Int_t iFebLy(0), jFeb(1); iFebLy < 4; iFebLy++) {
-      for (Int_t iFeb(0); iFeb < nofFebsHalf; iFeb++) {
-        feb_pos   = (iFeb + 0.5) / nofFebsHalf - 0.5;  // equal spacing of FEBs on the backpanel
-        feb_pos_x = feb_pos * activeAreaX;
-        feb_pos_y = activeAreaY / 4;
-
-        // move to final position over the detector for :
-        // the upper row ...
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-        // ... and the bottom row
-        trd_feb_position = new TGeoTranslation("", feb_pos_x, -feb_pos_y, zfeb_pos);
-        trd_feb_vol->AddNode(trd_feb_box, jFeb++, trd_feb_position);
-      }
-      zfeb_pos += febFASP_zspace;
-    }
-    if (IncludeRobs) {
-      TGeoVolumeAssembly* trd_rob_box = new TGeoVolumeAssembly("robbox");
-      TGeoBBox* trd_rob               = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_rob         = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of PCB
-      trdmod1_rob->SetLineColor(kRed);                                              // set color
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // Add connector PCB
-      TGeoBBox* trd_robConn = new TGeoBBox("trd_robConn", robConn_size_y / 2., robConn_size_x / 2., rob_thickness / 2.);
-      TGeoVolume* trdmod1_robConn = new TGeoVolume("robConn", trd_robConn, febVolMed);  // the ROB made of PCB
-      trdmod1_robConn->SetLineColor(kRed);                                              // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_robConn_position =
-        new TGeoTranslation("", robConn_xoffset, 0, -robConn_FMCheight - feb_thickness);
-      trd_rob_box->AddNode(trdmod1_robConn, 1, trd_robConn_position);
-
-      // Add FMC connector
-      TGeoBBox* trd_fmcConn =
-        new TGeoBBox("trd_fmcConn", robConn_FMCwidth / 2., robConn_FMClength / 2., robConn_FMCheight / 2.);
-      TGeoVolume* trdmod1_fmcConn = new TGeoVolume("robConn", trd_fmcConn, frameVolMed);  // the FMC  made of Al
-      trdmod1_fmcConn->SetLineColor(kGray);                                               // set color
-      // shift to x position on C-ROB3
-      TGeoTranslation* trd_fmcConn_position =
-        new TGeoTranslation("", robConn_xoffset + 2, 0, -robConn_FMCheight / 2 - feb_thickness / 2);
-      trd_rob_box->AddNode(trdmod1_fmcConn, 1, trd_fmcConn_position);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // put 3 GBTXs on each C-ROC
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);
-      trdmod1_gbtx->SetLineColor(kGreen);
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      for (Int_t iGbtxX(0), iGbtx(1); iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos   = (iGbtxX + 0.5) / nofGbtxX - 0.5;
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0) {
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos   = (iGbtxY + 0.5) / nofGbtxY - 0.5;
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++, trd_gbtx_trans1);
-          }
-        }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-      TGeoRotation* trd_rob_rotation = new TGeoRotation();
-      trd_rob_rotation->RotateZ(90.);
-      trd_rob_rotation->RotateX(90.);
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1], nofRobsHalf(nofRobs / 2);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);
-      }
-      trd_rob_rotation->RotateZ(180.);
-      for (Int_t iRob = 0; iRob < nofRobsHalf; iRob++) {
-        rob_pos                        = (iRob + 0.5) / nofRobsHalf - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y                      = rob_pos * activeAreaY;
-        trd_rob_y_position             = new TGeoTranslation("", rob_zoffset, rob_pos_y, sizeY / 2. + rob_yoffset);
-        TGeoHMatrix* trd_rob_transform = new TGeoHMatrix("");
-        (*trd_rob_transform)           = (*trd_rob_rotation) * (*trd_rob_y_position);
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_transform);  // position FEB in y
-      }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          cout << "layer " << layerId << " - xPos " << xPos << endl;
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21b.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21b.C
deleted file mode 100644
index d8bec3bfdc..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21b.C
+++ /dev/null
@@ -1,4568 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-///
-/// \file Create_TRD_Geometry_v21b.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2021-10-10 - AB - v21b    - based on v21b. Correct order of TRD(2D) modules in the set-up
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v21b_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 180., 360., 410., 550.};  // move 1st TRD to z=180 cm  // mCBM 2021_07
-//const Double_t zfront[5] = {260., 177., 360., 410., 550.};  // move 1st TRD to z=177 cm
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-//Int_t BusBarOrientation[MaxLayers] = {1, 1, 0, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-Int_t BusBarOrientation[MaxLayers] = {0, 0, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 20, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 2, 1, 1,
-  1, 1, 2, 3};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype, 3 = mCBM Bucharest TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 2};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 6,  1};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 30, 2};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 406, 406};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-//const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v21b()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  LayerPosition[0] = -54;
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      //exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0., -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  //trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    //TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    //TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  //vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1 =
-      new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2 =
-      new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3 =
-      new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  //vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    //TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc", sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    //TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb", sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    //TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu", sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  //vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  //15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  //vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  //vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  //vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  //vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3, 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(1); rFeb < 5; rFeb++) {
-          // the upper side ...
-          //         vol_feb->AddNode(faspro, iFeb++,
-          //                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx), (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3.,
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy) + FASPRO_width / 2, 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3., 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      //place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   // equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",  -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot"); crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",  0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos); crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix(""); (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(
-      vol_feb, 1,
-      new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          if (layerId == 2) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 3) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-          cout << "DESH layer " << layerId << " xPos " << xPos << endl;
-          cout << "DESH layer " << layerId << " yPos " << yPos << endl;
-          cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] << " " << LayerThickness / 2 << " "
-               << dz << endl;
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  //install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    xPos = xPos - 35.5;
-    zPos = -2.0 + 13.5;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] + LayerThickness / 2 << " " << zPos << endl;
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, /*LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos*/
-                       LayerPosition[layerId] + LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      if (l == 2) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 3) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21c.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21c.C
deleted file mode 100644
index 2319bce46c..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21c.C
+++ /dev/null
@@ -1,4578 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-///
-/// \file Create_TRD_Geometry_v21c.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2022-02-15 - DE - v21c    - based on v21b. Correct orientation of TRD(1D) modules in the set-up
-// 2021-10-10 - AB - v21b    - based on v21b. Correct order of TRD(2D) modules in the set-up
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v21c_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 180., 360., 410., 550.};  // move 1st TRD to z=180 cm  // mCBM 2021_07
-//const Double_t zfront[5] = {260., 177., 360., 410., 550.};  // move 1st TRD to z=177 cm
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-//Int_t BusBarOrientation[MaxLayers] = {1, 1, 0, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-Int_t BusBarOrientation[MaxLayers] = {0, 0, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 20, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 803, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 2, 1, 1,
-  1, 1, 2, 3};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype, 3 = mCBM Bucharest TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 2};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 6,  1};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 30, 2};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 406, 406};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-//const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v21c()
-{
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  LayerPosition[0] = -54;
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      //exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0., -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  //trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    //TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    //TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  //vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1 =
-      new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2 =
-      new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3 =
-      new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  //vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    //TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc", sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    //TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb", sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    //TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu", sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  //vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  //15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  //vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  //vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  //vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  //vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3, 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(1); rFeb < 5; rFeb++) {
-          // the upper side ...
-          //         vol_feb->AddNode(faspro, iFeb++,
-          //                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx), (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3.,
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy) + FASPRO_width / 2, 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3., 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      //place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   // equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",  -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot"); crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",  0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos); crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix(""); (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(
-      vol_feb, 1,
-      new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          if (layerId == 2) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 3) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-          cout << "DESH layer " << layerId << " xPos " << xPos << endl;
-          cout << "DESH layer " << layerId << " yPos " << yPos << endl;
-          cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] << " " << LayerThickness / 2 << " "
-               << dz << endl;
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  //install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    xPos = xPos - 35.5;
-    zPos = -2.0 + 13.5;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] + LayerThickness / 2 << " " << zPos << endl;
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, /*LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos*/
-                       LayerPosition[layerId] + LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      if (l == 2) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 3) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21d.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21d.C
deleted file mode 100644
index e20568a04e..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v21d.C
+++ /dev/null
@@ -1,4587 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-///
-/// \file Create_TRD_Geometry_v21d.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2022-02-15 - DE - v21d    - based on v21c. Correct material in gibbet bars
-// 2022-02-15 - DE - v21c    - based on v21b. Correct orientation of TRD(1D) modules in the set-up
-// 2021-10-10 - AB - v21b    - based on v21b. Correct order of TRD(2D) modules in the set-up
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v21d_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 180., 360., 410., 550.};  // move 1st TRD to z=180 cm  // mCBM 2021_07
-//const Double_t zfront[5] = {260., 177., 360., 410., 550.};  // move 1st TRD to z=177 cm
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-//Int_t BusBarOrientation[MaxLayers] = {1, 1, 0, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-Int_t BusBarOrientation[MaxLayers] = {0, 0, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 20, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 803, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 2, 1, 1,
-  1, 1, 2, 3};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype, 3 = mCBM Bucharest TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 2};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 6,  1};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 30, 2};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 406, 406};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-//const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v21d()
-{
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  LayerPosition[0] = -54;
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      //exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  FairGeoMedium* KANYAProfile10x10Strong = geoMedia->getMedium(Kanya10x10sVolumeMedium);
-  FairGeoMedium* KANYAProfile10x10Normal = geoMedia->getMedium(Kanya10x10nVolumeMedium);
-  FairGeoMedium* KANYAProfile3x5Normal   = geoMedia->getMedium(Kanya03x05nVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  geoBuild->createMedium(KANYAProfile10x10Strong);
-  geoBuild->createMedium(KANYAProfile10x10Normal);
-  geoBuild->createMedium(KANYAProfile3x5Normal);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0., -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  //trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    //TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    //TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  //vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1 =
-      new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2 =
-      new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3 =
-      new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  //vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    //TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc", sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    //TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb", sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    //TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu", sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  //vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  //15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  //vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  //vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  //vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  //vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3, 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(1); rFeb < 5; rFeb++) {
-          // the upper side ...
-          //         vol_feb->AddNode(faspro, iFeb++,
-          //                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx), (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3.,
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy) + FASPRO_width / 2, 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3., 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      //place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   // equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",  -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot"); crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",  0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos); crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix(""); (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(
-      vol_feb, 1,
-      new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          if (layerId == 2) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 3) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-          cout << "DESH layer " << layerId << " xPos " << xPos << endl;
-          cout << "DESH layer " << layerId << " yPos " << yPos << endl;
-          cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] << " " << LayerThickness / 2 << " "
-               << dz << endl;
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  //install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    xPos = xPos - 35.5;
-    zPos = -2.0 + 13.5;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] + LayerThickness / 2 << " " << zPos << endl;
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, /*LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos*/
-                       LayerPosition[layerId] + LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      if (l == 2) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 3) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C
deleted file mode 100644
index 94e5e121b4..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C
+++ /dev/null
@@ -1,4825 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-// clang-format off
-
-///
-/// \file Create_TRD_Geometry_v22a.C
-/// \brief Generates TRD geometry in Root format.
-///
-// 2021-10-28 - SR - v22b    - based on v22a the TRD-2D is removed 
-// 2021-10-07 - SR - v22a    - based on v20b the TRD-2D is inserted
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v22a_mcbm";
-// const TString subVersion   = "_1h";
-// const TString subVersion   = "_1e";
-// const TString subVersion   = "_1m";
-// const TString subVersion   = "_3e";
-// const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-// const Double_t zfront[5]  = {260., 410., 360., 410., 550.};
-const Double_t zfront[5] = {260., 99., 360., 410., 550.};  // move 1st TRD-1D z=99 cm  // mCBM 2022_02
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;  // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;  // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;  // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;  // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;  // false;  // true, if Al-ledge around the
-                                        // backpanel is included in geometry
-const Bool_t IncludeGibbet    = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs     = true;      // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs     = true;      // true, if ROBs are included in geometry
-const Bool_t IncludeAsics    = true;      // true, if ASICs are included in geometry
-const Bool_t IncludeSupports = false;     // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels   = false;     // false;  // true, if TRD (I, II, III)
-                                          // labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random
-                                      // displacement of modules for alignment
-                                      // study
-const Bool_t RotateRandom = false;    // true; // false;  // add random rotation of
-                                      // modules for alignment study
-const Bool_t DoExplode = false;       // true, // false;  // add random displacement
-                                      // of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of
-// different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// 1st layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// 2nd layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //
-// 5th layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //
-// 6th layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //
-// 9th layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  //
-// 10th layer only
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// Station 1, layer 1, 2
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  //
-// Station 2, layer 5, 6
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  //
-// Station 3, layer 9,10
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  //
-// Station 1 and 2
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  //
-// Station 1, 2 and 3
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// SIS100-2l  // 1: plot, 0: hide
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  //
-// SIS100-3l  // 1: plot, 0: hide
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  //
-// SIS100-4l  // 1: plot, 0: hide
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  //
-// SIS300-mu  // 1: plot, 0: hide
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  //
-// SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {0, 1, 1, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 10, 11, 20, 20, 21, 20, 21, 30, 31};  // ab: a [1-4] - layer
-                                                                              // type, b [0,1] -
-                                                                              // vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4)
-// with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-// Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28
-// - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28
-// - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16
-// - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28
-// - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28
-// - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-// Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28
-// - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25
-// - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25
-// - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25
-// - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-// Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25
-// - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-// const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD
-// layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-// const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer
-// in cm
-// const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-// const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,
-// 0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to
-// LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-// const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,
-// 0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to
-// LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,
-// 0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to
-// LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,
-// 0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-// const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,
-// 0.,   0.,   5.,   0. };  // v13n       - z offset in addition to
-// LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-// const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a
-// module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-// const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,
-// 0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,
-//                              0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,
-//                              821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,
-//                              821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,
-//                              701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,
-//                              801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,
-//                              801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,
-//                              0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,
-//                              0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a
-// module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,
-// 0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,
-//                               821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,
-//                               821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,
-//                               621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,
-//                               601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,
-//                               601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,
-//                               801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,
-//                               801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,
-//                               0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {{323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg)
-                                                         // in odd - c even layers
-                             {223, 123, 121, 121, 221},
-                             {203, 103, 0, 101, 201},
-                             {203, 103, 101, 101, 201},
-                             {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1, 1, 1, 1, 2, 3};  // 0 = small module, 1 =
-                                                                          // large module, 2 = mCBM
-                                                                          // Bucharest prototype, 3
-                                                                          // = mCBM Bucharest
-                                                                          // TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-// const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,
-// 45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 1};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 18, 18};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333, 0,
-                                               55,  5,  3, 333333, 333333};  // for .geo.info - TODO: merge with above
-                                                                             // GbtxPerRob
-
-// const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1
-// }; // number of GBTx ROBs on module
-// const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103
-// }; // number of GBTx ASICs on ROB
-// const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3
-// }; // for .geo.info - TODO: merge with above GbtxPerRob
-// const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,
-// 3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 18, 18};  // number of FEBs on backside
-// const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2
-// }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108, 108, 108, 108, 410, 410};  // %100 gives
-                                                                                               // number of
-                                                                                               // ASICs on FEB,
-                                                                                               // /100 gives
-                                                                                               // grouping
-//// ultimate density - 540 mm
-// const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3
-// }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108
-// }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3
-///}; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch
-/// ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108
-///}; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108
-///}; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-// const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3
-// }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-// const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3
-// }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3,
-// therefore same
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-// const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1
-// }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch
-// ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216
-// }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-// const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3
-// }; // min (6) module types // number of FEBs on backside - reduced FEBs (64
-// ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108
-// }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-// const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3
-// }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-// const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3
-// }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3,
-// therefore same
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2
-};
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16
-};
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2
-};
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16
-};
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2
-};
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16
-};
-*/
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-// const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames
-// in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-// const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96
-// cm2 active area
-// const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-// const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice
-// frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-// const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of
-// radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-// const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick
-// lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-// const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS
-// ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-// const Double_t carbonBu0_position    = radiator_position + radiator_thickness
-// / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-// Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-// const TString MylarVolumeMedium       = "mylar";
-// const TString RadiatorVolumeMedium    = "polypropylene";
-// const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-void Create_TRD_Geometry_v22a()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only -
-    //    comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  // top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-}
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      // exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  // fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][0],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][1],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][2],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //    ActiveAreaX[ModuleType[im]], HeightOfSector[im][0],
-  //    ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //    PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //    ActiveAreaX[ModuleType[im]], HeightOfSector[im][1],
-  //    ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //    PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n",
-  //    ActiveAreaX[ModuleType[im]], HeightOfSector[im][2],
-  //    ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //    PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][0],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][1],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][2],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        "
-                 "channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 *
-        //        DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 *
-        //        DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 *
-        //        DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 *
-        //        DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 *
-        //        DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 *
-        //        DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already
-  // defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed =
-  //  gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY
-    //   /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator",
-    //     moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator",
-    //     moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new
-      //       TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping
-      //       volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no,
-                                                             t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no,
-                                     t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new
-      //       TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping
-      //       volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no,
-                                                             t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no,
-                                     t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new
-    //   TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton,
-    //   kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton",
-    //   moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas",
-  //   moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas",
-  //   moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new
-    //   TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper,
-    //   padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new
-    //   TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper,
-    //   padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new
-    //   TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb,
-    //   padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new
-    //   TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb,
-    //   padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new
-    //   TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb,
-    //   honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new
-    //   TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb,
-    //   honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new
-    //   TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon,
-    //   carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon",
-    //   moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    // TGeoVolumeAssembly* trd_feb_vol = new
-    // TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother
-    // volume of all FEBs
-    // TGeoVolumeAssembly* trd_feb_box = new
-    // TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for
-    // inclined FEBs, then shifted along y
-    // TGeoVolumeAssembly* trd_feb_vol = new
-    // TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother
-    // volume of all FEBs
-    // TGeoVolumeAssembly* trd_feb_box = new
-    // TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for
-    // inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2.
-    //  + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback,
-    //  zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty
-    //      operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) *
-    //        (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the
-    // TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb",
-    //      moduleType), trd_feb, febVolMed);  // the FEB made of a certain
-    //      medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb",
-    //      moduleType), trd_feb, febVolMed);  // the FEB made of a certain
-    //      medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic",
-      //        moduleType), trd_asic, asicVolMed);   // the ASIC made of a
-      //        certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic",
-      //        moduleType), trd_asic, asicVolMed);   // the ASIC made of a
-      //        certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs
-                                                      // on the FEB, e.g. for
-                                                      // no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / (nofAsics / groupAsics) - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 :
-                                                            // -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / (nofAsics / groupAsics) - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 :
-                                                            // -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-      //        0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1,
-                           trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on
-                                                     // the FEB, e.g. for no=3 :
-                                                     // -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos = (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of
-                                                         // GBTXs on the FEB,
-                                                         // e.g. for no=3 : -1/3,
-                                                         // 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by
-          // default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1,
-                             trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at
-                                                             // correct z
-                                                             // position wrt to
-                                                             // the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed =
-  //  gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest
-                         // prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0.,
-    //                     -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care
-  // in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  // trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    // TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn),
-    // sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    // TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn),
-    // sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  // vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1       = new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2.,
-                                        0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2       = new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2.,
-                                        0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3       = new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2.,
-                                        0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  // vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    // TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc",
-    // sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    // TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb",
-    // sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    // TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu",
-    // sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  // vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  // 15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the
-    // TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  // vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  // vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  // vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  // vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(-1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb+1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx), 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(0); rFeb < 5; rFeb++) {
-          // the upper side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx),
-                            (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx),
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy), 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx), 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      // place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   //
-      //         equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",
-      //         -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot");
-      //         crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",
-      //         0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos);
-      //         crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix("");
-      //         (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(vol_feb, 1, new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at
-                                                                                    // correct z position
-                                                                                    // wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];                // 2 digits // fPlane   // layer type as leading
-                                               // digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation,
-          //          copyNrIn[type - 1], PlaneId[layerId], modId);  // with
-          //          modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1],
-          //          isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to
-                                                 // start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id / 10 % 10) * 90.);  // rotate module by   0 or 180
-                                                                    // degrees, see layer[1-3][i,o] -
-                                                                    // vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id % 10) * 90.);  // rotate module
-                                                               // by  90 or 270
-                                                               // degrees, see
-                                                               // layer[1-3][i,o]
-                                                               // - horizontal
-                                                               // pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type -
-          //          1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation,
-          //          copyNrOut[type - 5],  PlaneId[layerId], modId);  // with
-          //          modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5],
-          //          isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to
-                                                 // start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id / 10 % 10) * 90.);  // rotate module by   0 or 180
-                                                                    // degrees, see layer[1-3][i,o] -
-                                                                    // vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id % 10) * 90.);  // rotate module
-                                                               // by  90 or 270
-                                                               // degrees, see
-                                                               // layer[1-3][i,o]
-                                                               // - horizontal
-                                                               // pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed
-          //          reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId *
-          // LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift
-          // module along x-axis
-          xPos = 0;
-          /*  if (layerId == 0) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 1) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-          cout << "DESH layer " << layerId << " - xPos " << xPos << endl;
-          */
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. -
-          //            FrameWidth[1]) / (zfront[setupid] + ilayer *
-          //            LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " <<
-          //            frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos <<
-          //            endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer
-          //            * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos <<
-          //            endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan(
-          //            frameangle[3] ) * (zfront[setupid] + ilayer *
-          //            LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos <<
-          //            endl;
-          //	  }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  // install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    // DESH
-    xPos = 0;
-    yPos = 0;
-    //    xPos = xPos - 35.5;
-    zPos = -2.0;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  // DESH
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0.,
-  //   rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      /*  if (l == 0) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 1) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      */
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for
-  //  TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for
-  //  TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for
-  //  TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the
-  //  same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the
-  //  same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the
-  //  same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is
-  //  vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new
-  //   TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new
-  //   TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new
-  //   TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner
-  //  aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner
-  //  aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of
-                                                     // support structure for
-                                                     // stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of
-                                                     // support structure for
-                                                     // stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height
-    //      /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,
-    //      I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2.,
-    //      I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. +
-    //      (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) +
-    //      (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. +
-    //      (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) +
-    //      (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C
deleted file mode 100644
index d9f3b3bebf..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C
+++ /dev/null
@@ -1,4574 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-// clang-format off
-
-///
-/// \file Create_TRD_Geometry_v22b.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2021-11-15 - AB - v22b    - based on v21b. Both TRD-2D modules are removed
-// 2021-10-10 - AB - v21b    - based on v21b. Correct order of TRD(2D) modules in the set-up
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v22b_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = {260., 410., 360., 410., 550.};
-const Double_t zfront[5] = {260., 180., 360., 410., 550.};  // move 1st TRD-1D z=99 cm  // mCBM 2022_02
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-//Int_t BusBarOrientation[MaxLayers] = {1, 1, 0, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 20, 20, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 2, 1, 1,
-  1, 1, 2, 3};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype, 3 = mCBM Bucharest TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 2};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 6,  1};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 30, 2};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 406, 406};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-//const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v22b()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  LayerPosition[0] = -54;
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-
-  // create medialist for this geometry                                                                   
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      //exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0., -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  //trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    //TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    //TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  //vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1 =
-      new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2 =
-      new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3 =
-      new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  //vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    //TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc", sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    //TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb", sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    //TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu", sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  //vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  //15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  //vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  //vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  //vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  //vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3, 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(1); rFeb < 5; rFeb++) {
-          // the upper side ...
-          //         vol_feb->AddNode(faspro, iFeb++,
-          //                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx), (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3.,
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy) + FASPRO_width / 2, 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3., 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      //place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   // equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",  -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot"); crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",  0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos); crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix(""); (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(
-      vol_feb, 1,
-      new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          if (layerId == 2) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 3) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-          cout << "DESH layer " << layerId << " xPos " << xPos << endl;
-          cout << "DESH layer " << layerId << " yPos " << yPos << endl;
-          cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] << " " << LayerThickness / 2 << " "
-               << dz << endl;
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  //install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    xPos = xPos - 35.5;
-    zPos = -2.0 + 13.5;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] + LayerThickness / 2 << " " << zPos << endl;
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, /*LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos*/
-                       LayerPosition[layerId] + LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      if (l == 2) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 3) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22c.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22c.C
deleted file mode 100644
index 1b0454b423..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22c.C
+++ /dev/null
@@ -1,4569 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-///
-/// \file Create_TRD_Geometry_v22c.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2022-02-10 - AB - v22c    - based on v21b. Update fro new externals jun19p3
-// 2021-10-10 - AB - v21b    - based on v21b. Correct order of TRD(2D) modules in the set-up
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v22c_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 180., 360., 410., 550.};  // move 1st TRD to z=180 cm  // mCBM 2021_07
-//const Double_t zfront[5] = {260., 177., 360., 410., 550.};  // move 1st TRD to z=177 cm
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-//Int_t BusBarOrientation[MaxLayers] = {1, 1, 0, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-Int_t BusBarOrientation[MaxLayers] = {0, 0, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 20, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 821, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 2, 1, 1,
-  1, 1, 2, 3};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype, 3 = mCBM Bucharest TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 2};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 6,  1};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 30, 2};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 406, 406};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-//const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v22c()
-{
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  LayerPosition[0] = -54;
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      //exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0., -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  //trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    //TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    //TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  //vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1 =
-      new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2 =
-      new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3 =
-      new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  //vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    //TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc", sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    //TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb", sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    //TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu", sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  //vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  //15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  //vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  //vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  //vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  //vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3, 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(1); rFeb < 5; rFeb++) {
-          // the upper side ...
-          //         vol_feb->AddNode(faspro, iFeb++,
-          //                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx), (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3.,
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy) + FASPRO_width / 2, 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3., 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      //place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   // equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",  -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot"); crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",  0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos); crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix(""); (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(
-      vol_feb, 1,
-      new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          if (layerId == 2) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 3) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-          cout << "DESH layer " << layerId << " xPos " << xPos << endl;
-          cout << "DESH layer " << layerId << " yPos " << yPos << endl;
-          cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] << " " << LayerThickness / 2 << " "
-               << dz << endl;
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  //install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    xPos = xPos - 35.5;
-    zPos = -2.0 + 13.5;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] + LayerThickness / 2 << " " << zPos << endl;
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, /*LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos*/
-                       LayerPosition[layerId] + LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      if (l == 2) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 3) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22d.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22d.C
deleted file mode 100644
index 5db9531391..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22d.C
+++ /dev/null
@@ -1,4590 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-// clang-format off
-
-///
-/// \file Create_TRD_Geometry_v22d.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2022-03-09 - DE - v22d    - based on v21d - for cabon run. Update positions for TRD-1D in x,y,z and for TRD-2D in z
-// 2022-02-15 - DE - v21d    - based on v21c. Correct material in gibbet bars
-// 2022-02-15 - DE - v21c    - based on v21b. Correct orientation of TRD(1D) modules in the set-up
-// 2021-10-10 - AB - v21b    - based on v21b. Correct order of TRD(2D) modules in the set-up
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v22d_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-const Double_t zfront[5] = {260., 162.2, 360., 410., 550.};  // move 1st TRD-1D to z=162.2 cm  // mCBM 2022_03_09 carbon
-//const Double_t zfront[5] = {260., 180., 360., 410., 550.};  // move 1st TRD to z=180 cm  // mCBM 2021_07
-//const Double_t zfront[5] = {260., 177., 360., 410., 550.};  // move 1st TRD to z=177 cm
-//const Double_t zfront[5]  = { 260., 140., 360., 410., 550. };
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-//Int_t BusBarOrientation[MaxLayers] = {1, 1, 0, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-Int_t BusBarOrientation[MaxLayers] = {0, 0, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 20, 10, 11, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 803, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103,   0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821},
-  {823, 823, 723, 623,   0,   0,   0, 621, 721, 821, 821},
-  {803, 803, 703, 603,   0,   0,   0, 601, 701, 801, 801},
-  {803, 803, 703, 603,   0,   0,   0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = { 0, 0, 0, 2, 1, 1, 1, 1, 2, 3 };  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype, 3 = mCBM Bucharest TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = { 70, 90, 90, 0, 80, 90, 90, 90, 0, 0 };  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 2};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 6,  1};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 30, 2};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 406, 406};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-//const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v22d()
-{
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  LayerPosition[0] = -54;
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.);
-  //  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      //exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  FairGeoMedium* KANYAProfile10x10Strong = geoMedia->getMedium(Kanya10x10sVolumeMedium);
-  FairGeoMedium* KANYAProfile10x10Normal = geoMedia->getMedium(Kanya10x10nVolumeMedium);
-  FairGeoMedium* KANYAProfile3x5Normal   = geoMedia->getMedium(Kanya03x05nVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  geoBuild->createMedium(KANYAProfile10x10Strong);
-  geoBuild->createMedium(KANYAProfile10x10Normal);
-  geoBuild->createMedium(KANYAProfile3x5Normal);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0., -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  //trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    //TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    //TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  //vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1 =
-      new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2 =
-      new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3 =
-      new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  //vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    //TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc", sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    //TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb", sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    //TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu", sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  //vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  //15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  //vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  //vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  //vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  //vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3, 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(1); rFeb < 5; rFeb++) {
-          // the upper side ...
-          //         vol_feb->AddNode(faspro, iFeb++,
-          //                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx), (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3.,
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy) + FASPRO_width / 2, 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3., 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      //place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   // equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",  -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot"); crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",  0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos); crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix(""); (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(
-      vol_feb, 1,
-      new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-	  if (layerId == 2) {
-            xPos += 7.;  // offset in x mCBM Carbon March 2022
-          }
-          if (layerId == 3) {
-            xPos += 7.;  // offset in x mCBM Carbon March 2022
-          }
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-          cout << "DESH layer " << layerId << " xPos " << xPos << endl;
-          cout << "DESH layer " << layerId << " yPos " << yPos << endl;
-          cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] << " " << LayerThickness / 2 << " "
-               << dz << endl;
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  //install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    xPos = xPos - 35.5;
-    zPos = -2.0 + 13.5;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] + LayerThickness / 2 << " " << zPos << endl;
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, /*LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos*/
-                       LayerPosition[layerId] + LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      if (l == 2) {
-        xPos = 7.;  // offset in x mCBM Carbon March 2022
-      }
-      if (l == 3) {
-        xPos = 7.;  // offset in x mCBM Carbon March 2022
-      }
-
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22e.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22e.C
deleted file mode 100644
index 8f2e5c019b..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22e.C
+++ /dev/null
@@ -1,4837 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-// clang-format off
-
-///
-/// \file Create_TRD_Geometry_v22e.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2022-03-10 - DE - v22e    - based on v21a - correct gibbet material and z-positions
-// 2021-10-28 - SR - v22b    - based on v22a the TRD-2D is removed 
-// 2021-10-07 - SR - v22a    - based on v20b the TRD-2D is inserted
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v22e_mcbm";
-// const TString subVersion   = "_1h";
-// const TString subVersion   = "_1e";
-// const TString subVersion   = "_1m";
-// const TString subVersion   = "_3e";
-// const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-// const Double_t zfront[5]  = {260., 410., 360., 410., 550.};
-const Double_t zfront[5] = {260., 162.2-27., 360., 410., 550.};  // move 1st TRD-1D z=99 cm  // mCBM 2022_02
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;  // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;  // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;  // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;  // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;  // false;  // true, if Al-ledge around the
-                                        // backpanel is included in geometry
-const Bool_t IncludeGibbet    = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs     = true;      // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs     = true;      // true, if ROBs are included in geometry
-const Bool_t IncludeAsics    = true;      // true, if ASICs are included in geometry
-const Bool_t IncludeSupports = false;     // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels   = false;     // false;  // true, if TRD (I, II, III)
-                                          // labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random
-                                      // displacement of modules for alignment
-                                      // study
-const Bool_t RotateRandom = false;    // true; // false;  // add random rotation of
-                                      // modules for alignment study
-const Bool_t DoExplode = false;       // true, // false;  // add random displacement
-                                      // of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of
-// different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// 1st layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// 2nd layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //
-// 5th layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //
-// 6th layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //
-// 9th layer only
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  //
-// 10th layer only
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// Station 1, layer 1, 2
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  //
-// Station 2, layer 5, 6
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  //
-// Station 3, layer 9,10
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  //
-// Station 1 and 2
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  //
-// Station 1, 2 and 3
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //
-// SIS100-2l  // 1: plot, 0: hide
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  //
-// SIS100-3l  // 1: plot, 0: hide
-//
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  //
-// SIS100-4l  // 1: plot, 0: hide
-// const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  //
-// SIS300-mu  // 1: plot, 0: hide
-// const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  //
-// SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-Int_t BusBarOrientation[MaxLayers] = {0, 1, 1, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {20, 10, 11, 20, 20, 21, 20, 21, 30, 31};  // ab: a [1-4] - layer
-                                                                              // type, b [0,1] -
-                                                                              // vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4)
-// with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-// Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28
-// - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28
-// - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16
-// - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28
-// - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28
-// - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-// Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28
-// - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25
-// - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25
-// - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-// Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25
-// - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-// Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25
-// - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-// const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD
-// layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-// const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer
-// in cm
-// const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-// const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,
-// 0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to
-// LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-// const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,
-// 0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to
-// LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,
-// 0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to
-// LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,
-// 0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-// const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,
-// 0.,   0.,   5.,   0. };  // v13n       - z offset in addition to
-// LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-// const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a
-// module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 803, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-// const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,
-// 0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,
-//                              0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,
-//                              821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,
-//                              821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,
-//                              701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,
-//                              801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,
-//                              801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,
-//                              0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,
-//                              0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a
-// module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,
-// 0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,
-//                               821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,
-//                               821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,
-//                               621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,
-//                               601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,
-//                               601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,
-//                               801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,
-//                               801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,
-//                               0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {{323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg)
-                                                         // in odd - c even layers
-                             {223, 123, 121, 121, 221},
-                             {203, 103, 0, 101, 201},
-                             {203, 103, 101, 101, 201},
-                             {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {0, 0, 0, 2, 1, 1, 1, 1, 2, 3};  // 0 = small module, 1 =
-                                                                          // large module, 2 = mCBM
-                                                                          // Bucharest prototype, 3
-                                                                          // = mCBM Bucharest
-                                                                          // TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-// const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,
-// 45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 1};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 18, 18};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {555, 55, 5, 333333, 0,
-                                               55,  5,  3, 333333, 333333};  // for .geo.info - TODO: merge with above
-                                                                             // GbtxPerRob
-
-// const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1
-// }; // number of GBTx ROBs on module
-// const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103
-// }; // number of GBTx ASICs on ROB
-// const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3
-// }; // for .geo.info - TODO: merge with above GbtxPerRob
-// const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,
-// 3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 18, 18};  // number of FEBs on backside
-// const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2
-// }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {210, 210, 210, 410, 108, 108, 108, 108, 410, 410};  // %100 gives
-                                                                                               // number of
-                                                                                               // ASICs on FEB,
-                                                                                               // /100 gives
-                                                                                               // grouping
-//// ultimate density - 540 mm
-// const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3
-// }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108
-// }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3
-///}; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch
-/// ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108
-///}; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108
-///}; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-// const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3
-// }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-// const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3
-// }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3,
-// therefore same
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-// const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1
-// }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch
-// ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216
-// }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-// const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3
-// }; // min (6) module types // number of FEBs on backside - reduced FEBs (64
-// ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108
-// }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-// const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3
-// }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-// const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3
-// }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3,
-// therefore same
-// const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108
-// }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2
-};
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16
-};
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2
-};
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16
-};
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2
-};
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16
-};
-*/
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-// const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames
-// in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-// const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96
-// cm2 active area
-// const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-// const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice
-// frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-// const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of
-// radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-// const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick
-// lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-// const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS
-// ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-// const Double_t carbonBu0_position    = radiator_position + radiator_thickness
-// / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-// Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-// const TString MylarVolumeMedium       = "mylar";
-// const TString RadiatorVolumeMedium    = "polypropylene";
-// const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-void Create_TRD_Geometry_v22e()
-{
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only -
-    //    comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  // top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-
-  // create medialist for this geometry
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-}
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      // exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  // fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][0],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][1],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][2],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //    ActiveAreaX[ModuleType[im]], HeightOfSector[im][0],
-  //    ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //    PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //    ActiveAreaX[ModuleType[im]], HeightOfSector[im][1],
-  //    ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //    PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n",
-  //    ActiveAreaX[ModuleType[im]], HeightOfSector[im][2],
-  //    ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //    PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][0],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][1],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n",
-  //  ActiveAreaX[ModuleType[im]], HeightOfSector[im][2],
-  //  ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]],
-  //  PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        "
-                 "channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 *
-        //        DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 *
-        //        DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 *
-        //        DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 *
-        //        DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 *
-        //        DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 *
-        //        DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already
-  // defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  FairGeoMedium* KANYAProfile10x10Strong = geoMedia->getMedium(Kanya10x10sVolumeMedium);
-  FairGeoMedium* KANYAProfile10x10Normal = geoMedia->getMedium(Kanya10x10nVolumeMedium);
-  FairGeoMedium* KANYAProfile3x5Normal   = geoMedia->getMedium(Kanya03x05nVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  geoBuild->createMedium(KANYAProfile10x10Strong);
-  geoBuild->createMedium(KANYAProfile10x10Normal);
-  geoBuild->createMedium(KANYAProfile3x5Normal);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed =
-  //  gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY
-    //   /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator",
-    //     moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator",
-    //     moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new
-      //       TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping
-      //       volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no,
-                                                             t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no,
-                                     t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new
-      //       TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping
-      //       volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no,
-                                                             t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no,
-                                     t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new
-    //   TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton,
-    //   kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton",
-    //   moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas",
-  //   moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas",
-  //   moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new
-    //   TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper,
-    //   padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new
-    //   TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper,
-    //   padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new
-    //   TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb,
-    //   padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new
-    //   TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb,
-    //   padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new
-    //   TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb,
-    //   honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new
-    //   TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb,
-    //   honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new
-    //   TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon,
-    //   carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon",
-    //   moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    // TGeoVolumeAssembly* trd_feb_vol = new
-    // TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother
-    // volume of all FEBs
-    // TGeoVolumeAssembly* trd_feb_box = new
-    // TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for
-    // inclined FEBs, then shifted along y
-    // TGeoVolumeAssembly* trd_feb_vol = new
-    // TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother
-    // volume of all FEBs
-    // TGeoVolumeAssembly* trd_feb_box = new
-    // TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for
-    // inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2.
-    //  + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback,
-    //  zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty
-    //      operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) *
-    //        (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the
-    // TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb",
-    //      moduleType), trd_feb, febVolMed);  // the FEB made of a certain
-    //      medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb",
-    //      moduleType), trd_feb, febVolMed);  // the FEB made of a certain
-    //      medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic",
-      //        moduleType), trd_asic, asicVolMed);   // the ASIC made of a
-      //        certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic",
-      //        moduleType), trd_asic, asicVolMed);   // the ASIC made of a
-      //        certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos = (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs
-                                                      // on the FEB, e.g. for
-                                                      // no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / (nofAsics / groupAsics) - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 :
-                                                            // -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / (nofAsics / groupAsics) - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 :
-                                                            // -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-      //        0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1,
-                           trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on
-                                                     // the FEB, e.g. for no=3 :
-                                                     // -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos = (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of
-                                                         // GBTXs on the FEB,
-                                                         // e.g. for no=3 : -1/3,
-                                                         // 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by
-          // default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1,
-                             trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at
-                                                             // correct z
-                                                             // position wrt to
-                                                             // the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed =
-  //  gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest
-                         // prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0.,
-    //                     -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care
-  // in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  // trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    // TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn),
-    // sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    // TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn),
-    // sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  // vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1       = new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2.,
-                                        0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2       = new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2.,
-                                        0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3       = new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2.,
-                                        0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  // vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    // TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc",
-    // sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    // TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb",
-    // sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    // if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    // TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu",
-    // sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  // vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  // 15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the
-    // TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  // vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  // vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  // vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  // vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(-1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb+1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx), 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(0); rFeb < 5; rFeb++) {
-          // the upper side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx),
-                            (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx),
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy), 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx), 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      // place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   //
-      //         equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",
-      //         -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot");
-      //         crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",
-      //         0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos);
-      //         crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix("");
-      //         (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(vol_feb, 1, new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at
-                                                                                    // correct z position
-                                                                                    // wrt to the module
-  }
-
-  return module;
-}
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];                // 2 digits // fPlane   // layer type as leading
-                                               // digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation,
-          //          copyNrIn[type - 1], PlaneId[layerId], modId);  // with
-          //          modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1],
-          //          isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to
-                                                 // start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id / 10 % 10) * 90.);  // rotate module by   0 or 180
-                                                                    // degrees, see layer[1-3][i,o] -
-                                                                    // vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id % 10) * 90.);  // rotate module
-                                                               // by  90 or 270
-                                                               // degrees, see
-                                                               // layer[1-3][i,o]
-                                                               // - horizontal
-                                                               // pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type -
-          //          1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation,
-          //          copyNrOut[type - 5],  PlaneId[layerId], modId);  // with
-          //          modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5],
-          //          isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to
-                                                 // start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id / 10 % 10) * 90.);  // rotate module by   0 or 180
-                                                                    // degrees, see layer[1-3][i,o] -
-                                                                    // vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ((module_id % 10) * 90.);  // rotate module
-                                                               // by  90 or 270
-                                                               // degrees, see
-                                                               // layer[1-3][i,o]
-                                                               // - horizontal
-                                                               // pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed
-          //          reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId *
-          // LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift
-          // module along x-axis
-          xPos = 0;
-          /*  if (layerId == 0) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 1) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-          cout << "DESH layer " << layerId << " - xPos " << xPos << endl;
-          */
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. -
-          //            FrameWidth[1]) / (zfront[setupid] + ilayer *
-          //            LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " <<
-          //            frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos <<
-          //            endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer
-          //            * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos <<
-          //            endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan(
-          //            frameangle[3] ) * (zfront[setupid] + ilayer *
-          //            LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos <<
-          //            endl;
-          //	  }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  // install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    // DESH
-    xPos = 0;
-    yPos = 0;
-    //    xPos = xPos - 35.5;
-    zPos = -2.0;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  // DESH
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0.,
-  //   rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      /*  if (l == 0) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 1) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      */
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for
-  //  TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for
-  //  TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for
-  //  TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the
-  //  same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the
-  //  same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the
-  //  same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is
-  //  vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new
-  //   TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new
-  //   TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new
-  //   TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner
-  //  aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner
-  //  aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of
-                                                     // support structure for
-                                                     // stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of
-                                                     // support structure for
-                                                     // stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height
-    //      /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,
-    //      I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2.,
-    //      I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. +
-    //      (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) +
-    //      (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. +
-    //      (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) +
-    //      (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with
-    // gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22f.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22f.C
deleted file mode 100644
index 5a4a119f8d..0000000000
--- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22f.C
+++ /dev/null
@@ -1,4585 +0,0 @@
-/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
-   SPDX-License-Identifier: GPL-3.0-only
-   Authors: David Emschermann [committer], Alexandru Bercuci */
-
-// clang-format off
-
-///
-/// \file Create_TRD_Geometry_v22f.C
-/// \brief Generates TRD geometry in Root format.
-///
-
-// 2022-03-10 - DE - v22f    - based on v21b - correct gibbet material and z-positions
-// 2021-11-15 - AB - v22b    - based on v21b. Both TRD-2D modules are removed
-// 2021-10-10 - AB - v21b    - based on v21b. Correct order of TRD(2D) modules in the set-up
-// 2021-09-28 - SR - v21b    - based on v21a the position is corrected
-// 2021-07-25 - AB - v21a    - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup
-// 2020-05-25 - DE - v20b    - based on v20a, use 2 TRD modules for 2021 setup
-// 2020-05-23 - DE - v20a    - add support structure to TRD v18q, realign module in x
-// 2018-08-24 - DE - v18q    - use only 1st 2 layers of TRD in 2018 setup
-// 2017-11-22 - DE - v18n    - do not generate mBUCH at z=125 cm, only mTRD
-// 2017-11-22 - DE - v18m    - mBUCH at z=125 cm, mTRD at z=149, 171, 193 and 215 cm - layer pitch 22 cm from CAD
-// 2017-11-03 - DE - v18l    - shift mTRD to z=140 cm for acceptance matching with mSTS (= same result as v18g)
-// 2017-11-03 - DE - v18k    - plot 4 mTRD modules first, then mBUCH to simplyfy the realignment in x (= same result as v18j)
-// 2017-11-02 - DE - v18j    - move Muenster TRD modules back to original positions in x (fix bug in v18i)
-// 2017-10-17 - DE - v18i    - add Bucharest 60x60 cm2 Bucharest TRD module with FASP ASICs
-// 2017-05-16 - DE - v18e    - re-align all TRD modules to same theta angle using left side of 4th TRD module as reference
-// 2017-05-02 - DE - v18a    - re-base miniTRD v18e on CBM TRD v17a
-// 2017-04-28 - DE - v17     - implement power bus bars as defined in the TDR
-// 2017-04-26 - DE - v17     - add aluminium ledge around backpanel
-// 2017-01-10 - DE - v17a_3e - replace 6 ultimate density by 9 super density FEBs for TRD type 1 modules
-// 2016-07-05 - FU - v16a_3e - identical to v15a, change the way the trd volume is exported to resolve a bug with TGeoShape destructor
-// 2015-01-08 - DE - v15a_3e - reduce frame thickness in large modules to 15 mm instead of 20 mm
-// 2014-06-25 - DE - v14a_3e - consists of only 3 small and 3 large modules types (was 4+4 before)
-// 2014-06-25 - DE - v14a_3e - inner part of all 3 stations is now identical
-// 2014-05-02 - DE - v14a_3e - redesign inner part of station 3, now with 5x5-1 small modules, like in station 1 and station 2
-// 2014-05-02 - DE - v14a_3e - include optional GBTX readout boards on each module
-// 2014-05-02 - DE - v14a_3e - introduce 3x5=15 Spadic FEBs for ultimate density on module type 1
-//
-// 2013-11-14 - DE - v13q_3e - generate information about pad plane layout (CbmTrdPads_v14a.h) for all module types in this macro
-//
-// 2013-11-04 - DE - v13p4 - adapt the number of front-end boards to the pad layout of the 540 mm modules
-// 2013-11-04 - DE - v13p4 - use 8 module types (4x S + 4x L) to better match the occupancy
-// 2013-10-31 - DE - v13p4 - modify the support structure of station 1 to match with the MUCH/RICH platform
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of VolumeAssembly - in run_sim.C save  9% of time compared to v13p7
-// 2013-10-29 - DE - v13p4 - build lattice grid as TGeoBBox instead of CompositeShape - in run_sim.C save 18% of time compared to v13p6
-//
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p1 - SIS 100 hadron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p2 - SIS 100 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p3 - SIS 100 muon
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p4 - SIS 300 electron
-// 2013-10-28 - DE - introduce new geometry naming scheme: v13p5 - SIS 300 muon
-// 2013-10-28 - DE - add option to draw the magnetic field vector in the magnet
-// 2013-09-27 - DE - do not use TGeoXtru to build the supports, use TGeoBBox instead
-//
-// 2013-06-25 - DE - v13g trd300_rich             (10 layers, z = 4100 ) - TRD right behind SIS300 RICH
-// 2013-06-25 - DE - v13h trd100_sts              ( 4 layers, z = 2600 ) - TRD completely on RICH/MUCH platform to allow TOF to move upstream
-// 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - v13k trd100_rich             ( 4 layers, z = 4100 ) - TRD right behind RICH
-// 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 ) - same as version at z = 4600
-// 2013-06-25 - DE - v13l trd100_much_3_absorbers ( 4 layers, z = 4600 ) - TRD right behind SIS100 MUCH
-// 2013-06-25 - DE - v13m trd300_much_6_absorbers (10 layers, z = 5500 ) - TRD right behind SIS300 MUCH
-// 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 ) - TRD stretched behind SIS300 RICH
-//
-// 2013-06-19 - DE - add TRD (I, II, III) labels on support structure
-// 2013-05-29 - DE - allow for flexible TRD z-positions defined by position of layer01
-// 2013-05-23 - DE - remove "trd_" prefix from node names (except top node)
-// 2013-05-22 - DE - radiators G30 (z=240 mm)
-// 2013-05-22 - DE - radiators H (z=275 mm - 125 * 2.2mm), (H++ z=335 mm)
-// 2013-05-22 - DE - radiators B++ (z=254 mm - 350 * 0.724 mm), K++ (z=254 mm - 350 * 0.724 mm)
-// 2013-04-17 - DE - introduce volume assembly for layers, e.g. trd_layer03
-// 2013-03-26 - DE - use Air as ASIC material
-// 2013-03-26 - DE - put support structure into its own assembly
-// 2013-03-26 - DE - move TRD upstream to z=400m
-// 2013-03-26 - DE - RICH will probably end at z=380 cm, TRD can move to 400 cm
-// 2013-03-25 - DE - shrink active area from 570 to 540 mm and 960 to 910 mm
-// 2013-03-06 - DE - add ASICs on FEBs
-// 2013-03-05 - DE - introduce supports for SIS100 and SIS300
-// 2013-03-05 - DE - replace all Float_t by Double_t
-// 2013-01-21 - DE - introduce TRD media, use TRDG10 as material for pad plane and FEBs
-// 2013-01-21 - DE - put backpanel into the geometry
-// 2013-01-11 - DE - allow for misalignment of TRD modules
-// 2012-11-04 - DE - add kapton foil, add FR4 padplane
-// 2012-11-03 - DE - add lattice grid on entrance window as CompositeShape
-
-// TODO:
-// - use Silicon as ASIC material
-
-// in root all sizes are given in cm
-
-#include "TDatime.h"
-#include "TFile.h"
-#include "TGeoArb8.h"
-#include "TGeoCompositeShape.h"
-#include "TGeoCone.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMatrix.h"
-#include "TGeoMedium.h"
-#include "TGeoPgon.h"
-#include "TGeoTube.h"
-#include "TGeoVolume.h"
-#include "TGeoXtru.h"
-#include "TList.h"
-#include "TRandom3.h"
-#include "TString.h"
-#include "TSystem.h"
-
-#include <iostream>
-
-// Name of output file with geometry
-const TString tagVersion = "v22f_mcbm";
-//const TString subVersion   = "_1h";
-//const TString subVersion   = "_1e";
-//const TString subVersion   = "_1m";
-//const TString subVersion   = "_3e";
-//const TString subVersion   = "_3m";
-
-const Int_t setupid = 1;  // 1e is the default
-//const Double_t zfront[5]  = {260., 410., 360., 410., 550.};
-const Double_t zfront[5] = {260., 162.2+2*27., 360., 410., 550.};  // move 1st TRD-1D z=99 cm  // mCBM 2022_02
-const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"};
-const TString subVersion  = setupVer[setupid];
-
-const TString geoVersion   = "trd_" + tagVersion;  //  + subVersion;
-const TString FileNameSim  = geoVersion + ".geo.root";
-const TString FileNameGeo  = geoVersion + "_geo.root";
-const TString FileNameInfo = geoVersion + ".geo.info";
-const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-
-// display switches
-const Bool_t IncludeRadiator = false;  // false;  // true, if radiator is included in geometry
-const Bool_t IncludeLattice  = true;   // false;  // true, if lattice grid is included in geometry
-
-const Bool_t IncludeKaptonFoil = true;   // false;  // true, if entrance window is included in geometry
-const Bool_t IncludeGasFrame   = true;   // false;  // true, if frame around gas volume is included in geometry
-const Bool_t IncludePadplane   = true;   // false;  // true, if padplane is included in geometry
-const Bool_t IncludeBackpanel  = true;   // false;  // true, if backpanel is included in geometry
-const Bool_t IncludeAluLedge   = true;   // false;  // true, if Al-ledge around the backpanel is included in geometry
-const Bool_t IncludeGibbet     = true;   // false;  // true, if mTRD gibbet support to be drawn
-const Bool_t IncludePowerbars  = false;  // false;  // true, if LV copper bus bars to be drawn
-
-const Bool_t IncludeFebs        = true;   // false;  // true, if FEBs are included in geometry
-const Bool_t IncludeRobs        = true;   // true, if ROBs are included in geometry
-const Bool_t IncludeAsics       = true;   // true, if ASICs are included in geometry
-const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-
-// positioning switches
-const Bool_t DisplaceRandom = false;  // true; // false;  // add random displacement of modules for alignment study
-const Bool_t RotateRandom   = false;  // true; // false;  // add random rotation of modules for alignment study
-const Bool_t DoExplode      = false;  // true, // false;  // add random displacement of modules for alignment study
-
-// positioning parameters
-const Double_t maxdx = 0.2;  // max +- 0.1 cm shift in x
-const Double_t maxdy = 0.2;  // max +- 0.1 cm shift in y
-const Double_t maxdz = 1.0;  // max +- 1.0 cm shift in z
-
-const Double_t maxdrotx = 2.0;  // 20.0; // max rotation around x
-const Double_t maxdroty = 2.0;  // 20.0; // max rotation around y
-const Double_t maxdrotz = 2.0;  // 20.0; // max rotation around z
-
-const Double_t ExplodeFactor = 1.02;  // 1.02; // Factor by which modules are exploded in the x/y plane
-
-// initialise random numbers
-TRandom3 r3(0);
-
-// Parameters defining the layout of the complete detector build out of different detector layers.
-const Int_t MaxLayers = 10;  // max layers
-
-// select layers to display
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  //  1st layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  //  2nd layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 };  //  5th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };  //  6th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };  //  9th layer only
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };  // 10th layer only
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // Station 1, layer 1, 2
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 2, layer 5, 6
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };  // Station 3, layer 9,10
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };  // Station 1 and 2
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 1, 1, 1, 0, 1, 1 };  // Station 1, 2 and 3
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-2l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };  // SIS100-3l  // 1: plot, 0: hide
-//
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };  // SIS100-4l  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 };  // SIS300-mu  // 1: plot, 0: hide
-//const Int_t    ShowLayer[MaxLayers] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };  // SIS300-e   // 1: plot, 0: hide
-Int_t ShowLayer[MaxLayers] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};  // SIS100-4l is default
-
-//Int_t BusBarOrientation[MaxLayers] = {1, 1, 0, 0, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-Int_t BusBarOrientation[MaxLayers] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};  // 1 = vertical
-
-Int_t PlaneId[MaxLayers];  // automatically filled with layer ID
-
-const Int_t LayerType[MaxLayers] = {10, 11, 20, 20, 20, 21,
-                                    20, 21, 30, 31};  // ab: a [1-4] - layer type, b [0,1] - vertical/horizontal pads
-// ### Layer Type 20 is mCBM Layer Type 2 with Buch prototype module (type 4) with vertical pads
-// ### Layer Type 11 is Layer Type 1 with detector modules rotated by 90??
-// ### Layer Type 21 is Layer Type 2 with detector modules rotated by 90??
-// ### Layer Type 31 is Layer Type 3 with detector modules rotated by 90??
-// In the subroutine creating the layers this is recognized automatically
-
-const Int_t LayerNrInStation[MaxLayers] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2};
-
-Double_t LayerPosition[MaxLayers] = {0.};  // start position = 0 - 2016-07-12 - DE
-
-// 5x z-positions from 260 till 550 cm
-//Double_t LayerPosition[MaxLayers] = { 260. }; // start position - 2013-10-28 - DE - v14_1h - SIS 100 hadron         ( 4 layers, z = 2600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_1e - SIS 100 electron       ( 4 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 360. }; // start position - 2014-06-16 - DE - v14_1m - SIS 100 muon           ( 4 layers, z = 3600 ) was 460.
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-10-28 - DE - v14_3e - SIS 300 electron       (10 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 550. }; // start position - 2013-10-28 - DE - v14_3m - SIS 300 muon     6_abs (10 layers, z = 5500 )
-//
-// obsolete variants
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-10-28 - DE - v13x3 - SIS 100 muon         ( 4 layers, z = 4600 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13i trd100_rich             ( 2 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 410. }; // start position - 2013-06-25 - DE - v13j trd100_rich             ( 3 layers, z = 4100 )
-//Double_t LayerPosition[MaxLayers] = { 430. }; // start position - 2013-06-25 - DE - ---  trd100_much_2_absorbers ( 4 layers, z = 4300 )
-//Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-
-
-//const Double_t LayerThickness = 22.0;  // miniCBM - Thickness of one TRD layer in cm
-const Double_t LayerThickness = 27.0;  // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-//const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-
-const Double_t LayerOffset[MaxLayers] = {0., 0., 0., 0., -112.,
-                                         0., 0., 0., 5., 0.};  // v13x[4,5] - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 140 / 165 / 190 / 215 / 240 - 115 = 125
-//const Double_t LayerOffset[MaxLayers]    = {   0.,    0.,   0.,   0., -115.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 115 / 140 / 165 / 190 / 215 - 125 = 100
-
-// const Double_t LayerOffset[MaxLayers] = {   0.,  -10.,   0.,   0.,   0.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness
-// 100 / 125 - 10 = 115 / 140 / 165 / 190
-
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness
-//const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,  95.,   0.,   0.,   0.,   5.,   0. };  // v13n       - z offset in addition to LayerThickness
-
-const Int_t LayerArraySize[3][4] = {{5, 5, 9, 11},  // for layer[1-3][i,o] below
-                                    {5, 5, 9, 11},
-                                    {5, 5, 9, 11}};
-
-
-// ### Layer Type 1
-// v14x - module types in the inner sector of layer type 1 - looking upstream
-const Int_t layer1i[5][5] = {{0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0},
-                             //                            {   0,    0,  101,    0,    0 },
-                             {0, 0, 0, 0, 0},
-                             {0, 0, 0, 0, 0}};
-
-//const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                              { 223,  123,  121,  121,  221 },
-//                              { 203,  103,    0,  101,  201 },
-//                              { 203,  103,  101,  101,  201 },
-//                              { 303,  303,  301,  301,  301 } };
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 1 - looking upstream
-const Int_t layer1o[9][11] = {
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 803, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-//// v14x - module types in the outer sector of layer type 1 - looking upstream
-//const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-//                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-//                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-//                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-//                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-// number of modules: 26
-// Layer1 =  24 + 26;   // v14a
-
-
-// ### Layer Type 2 -> remapped for Buch prototype
-// v14x - module types in the inner sector of layer type 2 - looking upstream
-// const Int_t layer2i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-//                               { 223,  123,  121,  121,  221 },
-//                               { 203,  103,    0,  101,  201 },
-//                               { 203,  103,  101,  101,  201 },
-//                               { 303,  303,  301,  301,  301 } };
-const Int_t layer2i[5][5] = {{0},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-                             {0},
-                             {0, 0, 900, 0, 0},
-                             {0},
-                             {0}};
-
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 2 - looking upstream
-// const Int_t layer2o[9][11]= { {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-//                               {   0,  823,  823,  823,  823,  821,  821,  821,  821,  821,    0 },
-//                               {   0,  823,  823,  823,  723,  721,  721,  821,  821,  821,    0 },
-//                               {   0,  823,  723,  623,    0,    0,    0,  621,  721,  821,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  703,  603,    0,    0,    0,  601,  701,  801,    0 },
-//                               {   0,  803,  803,  803,  703,  701,  701,  801,  801,  801,    0 },
-//                               {   0,  803,  803,  803,  803,  801,  801,  801,  801,  801,    0 },
-//                               {   0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-const Int_t layer2o[9][11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
-// number of modules: 54
-// Layer2 =  24 + 54;   // v14a
-
-
-// ### Layer Type 3
-// v14x - module types in the inner sector of layer type 3 - looking upstream
-const Int_t layer3i[5][5] = {
-  {323, 323, 321, 321, 321},  // abc: a module type - b orientation (x90 deg) in odd - c even layers
-  {223, 123, 121, 121, 221},
-  {203, 103, 0, 101, 201},
-  {203, 103, 101, 101, 201},
-  {303, 303, 301, 301, 301}};
-// number of modules: 24
-
-// v14x - module types in the outer sector of layer type 3 - looking upstream
-const Int_t layer3o[9][11] = {
-  {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821}, {823, 823, 823, 823, 823, 821, 821, 821, 821, 821, 821},
-  {823, 823, 823, 723, 623, 621, 621, 721, 821, 821, 821}, {823, 823, 723, 623, 0, 0, 0, 621, 721, 821, 821},
-  {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},       {803, 803, 703, 603, 0, 0, 0, 601, 701, 801, 801},
-  {803, 803, 803, 703, 603, 601, 601, 701, 801, 801, 801}, {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801},
-  {803, 803, 803, 803, 803, 801, 801, 801, 801, 801, 801}};
-// number of modules: 90
-// Layer2 =  24 + 90;   // v14a
-
-
-// Parameters defining the layout of the different detector modules
-const Int_t NofModuleTypes             = 10;
-const Int_t ModuleType[NofModuleTypes] = {
-  0, 0, 0, 2, 1, 1,
-  1, 1, 2, 3};  // 0 = small module, 1 = large module, 2 = mCBM Bucharest prototype, 3 = mCBM Bucharest TRD-2Dh prototype
-
-// FEB inclination angle
-const Double_t feb_rotation_angle[NofModuleTypes] = {
-  70, 90, 90, 0, 80, 90, 90, 90, 0, 0};  // rotation around x-axis, 0 = vertical, 90 = horizontal
-//const Double_t feb_rotation_angle[NofModuleTypes] = { 45,  45,  45,  45,  45,  45,  45,  45 }; // rotation around x-axis, 0 = vertical, 90 = horizontal
-
-// GBTx ROB definitions
-const Int_t RobsPerModule[NofModuleTypes] = {3, 2, 1, 6, 2, 2, 1, 1, 30, 2};  // number of GBTx ROBs on module
-const Int_t GbtxPerRob[NofModuleTypes]    = {105, 105, 105, 103, 107,
-                                          105, 105, 103, 103, 103};  // number of GBTx ASICs on ROB
-
-const Int_t GbtxPerModule[NofModuleTypes]   = {15, 10, 5, 18, 0,
-                                             10, 5,  3, 6,  1};  // for .geo.info - TODO: merge with above GbtxPerRob
-const Int_t RobTypeOnModule[NofModuleTypes] = {
-  555, 55, 5, 333333, 0, 55, 5, 3, 333333, 333333};  // for .geo.info - TODO: merge with above GbtxPerRob
-
-//const Int_t RobsPerModule[NofModuleTypes] = {  2,  2,  1,  1,  2,  2,  1,  1 }; // number of GBTx ROBs on module
-//const Int_t GbtxPerRob[NofModuleTypes]    = {107,105,105,103,107,105,105,103 }; // number of GBTx ASICs on ROB
-//const Int_t GbtxPerModule[NofModuleTypes] = { 14,  8,  5,  0,  0, 10,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-//const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-
-// super density for type 1 modules - 2017 - 540 mm
-const Int_t FebsPerModule[NofModuleTypes] = {9, 5, 6, 18, 12, 8, 4, 3, 30, 2};  // number of FEBs on backside
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-const Int_t AsicsPerFeb[NofModuleTypes] = {
-  210, 210, 210, 410, 108, 108, 108, 108, 406, 406};  // %100 gives number of ASICs on FEB, /100 gives grouping
-//// ultimate density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,105,105,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  6,  3,  4,  3 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {315,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-////const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-////// super density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 540 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 18, 10,  6,  4, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-// ultimate density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  2,  5,  3,  2,  1 }; // min number of FEBs // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,216,216,216,216 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  3,  3, 10,  5,  3,  3 }; // min (6) module types // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {216,210,210,210,108,108,108,108 }; //  %100 gives number of ASICs on FEB, /100 gives grouping
-//// super density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 10,  5,  5,  5, 12,  6,  4,  3 }; // light // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-//
-//// normal density - 570 mm
-//const Int_t FebsPerModule[NofModuleTypes] = { 19, 10,  5,  5, 12,  6,  4,  3 }; // number of FEBs on backside (linked to pad layout) - mod4 = mod3, therefore same
-//const Int_t AsicsPerFeb[NofModuleTypes]   = {105,105,105,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-
-
-/* TODO: activate connector grouping info below
-// ultimate - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  6,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// super    - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  4,  4,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-// normal   - grouping of pads to connectors
-const Int_t RowsPerConnector[NofModuleTypes]  = {  2,  2,  2,  2,  2,  2,  2,  2 };
-const Int_t ColsPerConnector[NofModuleTypes]  = { 16, 16, 16, 16, 16, 16, 16, 16 };
-*/
-
-
-const Double_t feb_z_offset = 0.1;  // 1 mm - offset in z of FEBs to backpanel
-const Double_t asic_offset  = 0.1;  // 1 mm - offset of ASICs to FEBs to avoid overlaps
-
-// ASIC parameters
-Double_t asic_distance;
-
-//const Double_t FrameWidth[2]    = { 1.5, 2.0 };   // Width of detector frames in cm
-const Double_t FrameWidth[4] = {1.5, 1.5, 2.5, 1.5};  // Width of detector frames in cm
-// mini - production
-const Double_t DetectorSizeX[4] = {57., 95., 59.0, 23.04 + 3.};  // => 54 x 54 cm2 & 91 x 91 cm2 active area
-const Double_t DetectorSizeY[4] = {57., 95., 60.8, 8.16 + 3.};   // quadratic modules
-//// default
-//const Double_t DetectorSizeX[2] = { 60., 100.};   // => 57 x 57 cm2 & 96 x 96 cm2 active area
-//const Double_t DetectorSizeY[2] = { 60., 100.};   // quadratic modules
-
-// Parameters tor the lattice grid reinforcing the entrance window
-//const Double_t lattice_o_width[2] = { 1.5, 2.0 };   // Width of outer lattice frame in cm
-const Double_t lattice_o_width[2] = {1.5, 1.5};  // Width of outer lattice frame in cm
-const Double_t lattice_i_width[2] = {0.2, 0.2};  // { 0.4, 0.4 };   // Width of inner lattice frame in cm
-// Thickness (in z) of lattice frames in cm - see below
-
-// statistics
-Int_t ModuleStats[MaxLayers][NofModuleTypes] = {0};
-
-// z - geometry of TRD modules
-const Double_t radiator_thickness = 0.0;  // 35 cm thickness of radiator
-//const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-const Double_t radiator_position = -LayerThickness / 2. + radiator_thickness / 2.;
-
-//const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_thickness = 1.0 - 0.0025;  // 0.9975;  // 1.0;  // 10 mm thick lattice frames
-const Double_t lattice_position  = radiator_position + radiator_thickness / 2. + lattice_thickness / 2.;
-
-const Double_t kapton_thickness = 0.0025;  //  25 micron thickness of kapton
-const Double_t kapton_position  = lattice_position + lattice_thickness / 2. + kapton_thickness / 2.;
-
-const Double_t gas_thickness = 1.2;  //  12 mm thickness of gas
-const Double_t gas_position  = kapton_position + kapton_thickness / 2. + gas_thickness / 2.;
-
-// frame thickness
-const Double_t frame_thickness = gas_thickness;  // frame covers gas volume: from kapton foil to pad plane
-const Double_t frame_position =
-  -LayerThickness / 2. + radiator_thickness + lattice_thickness + kapton_thickness + frame_thickness / 2.;
-
-// pad plane
-const Double_t padcopper_thickness = 0.0025;  //  25 micron thickness of copper pads
-const Double_t padcopper_position  = gas_position + gas_thickness / 2. + padcopper_thickness / 2.;
-
-const Double_t padplane_thickness = 0.0360;  // 360 micron thickness of padplane
-const Double_t padplane_position  = padcopper_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-
-// backpanel components
-const Double_t carbon_thickness = 0.0190 * 2;  // use 2 layers!!   // 190 micron thickness for 1 layer of carbon fibers
-const Double_t honeycomb_thickness = 2.3 - kapton_thickness - padcopper_thickness - padplane_thickness
-                                     - carbon_thickness;  //  ~ 2.3 mm thickness of honeycomb
-const Double_t honeycomb_position = padplane_position + padplane_thickness / 2. + honeycomb_thickness / 2.;
-const Double_t carbon_position    = honeycomb_position + honeycomb_thickness / 2. + carbon_thickness / 2.;
-
-// aluminium thickness
-const Double_t aluminium_thickness = 0.4;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_width     = 1.0;  // crossbar of 1 x 1 cm at every module edge
-const Double_t aluminium_position  = carbon_position + carbon_thickness / 2. + aluminium_thickness / 2.;
-
-// power bus bars
-const Double_t powerbar_thickness = 1.0;  // 1 cm in z direction
-const Double_t powerbar_width     = 2.0;  // 2 cm in x/y direction
-const Double_t powerbar_position  = aluminium_position + aluminium_thickness / 2. + powerbar_thickness / 2.;
-
-// gibbet support
-const Double_t gibbet_thickness = 10.0;  // 10 cm in z direction
-const Double_t gibbet_width     = 10.0;  // 10 cm in x/y direction
-const Double_t gibbet_position  = aluminium_position + aluminium_thickness / 2. + gibbet_thickness / 2.;
-
-// module rails
-const Double_t rail_thickness = 5.0;  // 5 cm in z direction
-const Double_t rail_width     = 3.0;  // 3 cm in x/y direction
-const Double_t rail_position  = aluminium_position + aluminium_thickness / 2. + rail_thickness / 2.;
-
-// readout boards
-//const  Double_t feb_width           =  10.0;    // width of FEBs in cm
-const Double_t feb_width          = 8.5;   // width of FEBs in cm
-const Double_t feb_thickness      = 0.25;  // light //  2.5 mm thickness of FEBs
-const Double_t febvolume_position = aluminium_position + aluminium_thickness / 2. + feb_width / 2.;
-
-// ASIC parameters
-const Double_t asic_thickness = 0.25;  // 2.5 mm asic_thickness
-const Double_t asic_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-
-// --------------      BUCHAREST PROTOTYPE SPECIFICS      ----------------------------------
-// Frontpanel components
-const Double_t carbonBu_thickness    = 0.03;  // 300 micron thickness for 1 layer of carbon fibers
-const Double_t honeycombBu_thickness = 0.94;  // 9 mm thickness of honeycomb
-const Double_t WIN_Frame_thickness   = 0.6;   // entrance window framing 6x12 mm2
-//const Double_t carbonBu0_position    = radiator_position + radiator_thickness / 2. + carbonBu_thickness / 2.;
-const Double_t honeycombBu0_position = radiator_position + radiator_thickness / 2. + honeycombBu_thickness / 2.;
-const Double_t carbonBu1_position    = honeycombBu0_position + honeycombBu_thickness / 2. + carbonBu_thickness / 2.;
-// Active volume
-const Double_t gasBu_position = carbonBu1_position + carbonBu_thickness / 2. + gas_thickness / 2.;
-// Pad plane
-const Double_t padcopperBu_position = gasBu_position + gas_thickness / 2. + padcopper_thickness / 2.;
-const Double_t padplaneBu_position  = padcopperBu_position + padcopper_thickness / 2. + padplane_thickness / 2.;
-// Backpanel components
-const Double_t honeycombBu1_position = padplaneBu_position + padplane_thickness / 2. + honeycombBu_thickness / 2.;
-// PCB
-const Double_t glassFibre_thickness = 0.0270;  // 300 microns overall PCB thickness
-const Double_t cuCoating_thickness  = 0.0030;
-const Double_t glassFibre_position  = honeycombBu1_position + honeycombBu_thickness / 2. + glassFibre_thickness / 2.;
-const Double_t cuCoating_position   = glassFibre_position + glassFibre_thickness / 2. + cuCoating_thickness / 2.;
-//Frame around entrance window, active volume and exit window
-const Double_t frameBu_thickness = 2 * carbonBu_thickness + honeycombBu_thickness + gas_thickness + padcopper_thickness
-                                   + padplane_thickness + honeycombBu_thickness + glassFibre_thickness
-                                   + cuCoating_thickness;
-const Double_t frameBu_position = radiator_position + radiator_thickness / 2. + frameBu_thickness / 2.;
-// ROB FASP
-const Double_t febFASP_zspace    = 1.5;  // gap size between boards
-const Double_t febFASP_width     = 5.5;  // width of FASP FEBs in cm
-const Double_t febFASP_position  = cuCoating_position + febFASP_width / 2. + 1.5;
-const Double_t febFASP_thickness = feb_thickness;
-
-// FASP-ASIC parameters
-const Double_t fasp_size[2] = {2, 2.5};  // FASP package size 2x3 cm2
-const Double_t fasp_xoffset = 1.35;      // ASIC offset from ROC middle (horizontally)
-const Double_t fasp_yoffset = 0.6;       // ASIC offset from DET connector (vertical)
-// GETS2C-ROB3 connector boord parameters
-const Double_t robConn_size_x    = 15.0;
-const Double_t robConn_size_y    = 6.0;
-const Double_t robConn_xoffset   = 6.0;
-const Double_t robConn_FMCwidth  = 1.5;  // width of a MF FMC connector
-const Double_t robConn_FMClength = 6.5;  // length of a MF FMC connector
-const Double_t robConn_FMCheight = 1.5;  // height of a MF FMC connector
-
-// C-ROB3 parameters : GBTx ROBs
-const Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-const Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-const Double_t rob_yoffset   = 0.3;   // offset wrt detector frame (on the detector plane)
-const Double_t rob_zoffset   = -7.5;  // offset wrt entrace plane - center board
-const Double_t rob_thickness = feb_thickness;
-// GBTX parameters
-const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-const Double_t gbtx_distance  = 0.4;
-
-
-// Names of the different used materials which are used to build the modules
-// The materials are defined in the global media.geo file
-const TString KeepingVolumeMedium     = "air";
-const TString RadiatorVolumeMedium    = "TRDpefoam20";
-const TString LatticeVolumeMedium     = "TRDG10";
-const TString KaptonVolumeMedium      = "TRDkapton";
-const TString GasVolumeMedium         = "TRDgas";
-const TString PadCopperVolumeMedium   = "TRDcopper";
-const TString PadPcbVolumeMedium      = "TRDG10";  // todo - put correct FEB material here
-const TString HoneycombVolumeMedium   = "TRDaramide";
-const TString CarbonVolumeMedium      = "TRDcarbon";
-const TString FebVolumeMedium         = "TRDG10";  // todo - put correct FEB material here
-const TString AsicVolumeMedium        = "air";     // todo - put correct ASIC material here
-const TString TextVolumeMedium        = "air";     // leave as air
-const TString FrameVolumeMedium       = "TRDG10";
-const TString PowerBusVolumeMedium    = "TRDcopper";  // power bus bars
-const TString AluLegdeVolumeMedium    = "aluminium";  // aluminium frame around backpanel
-const TString AluminiumVolumeMedium   = "aluminium";
-const TString Kanya10x10sVolumeMedium = "KANYAProfile10x10Strong";
-const TString Kanya10x10nVolumeMedium = "KANYAProfile10x10Normal";
-const TString Kanya03x05nVolumeMedium = "KANYAProfile3x5Normal";
-//const TString MylarVolumeMedium       = "mylar";
-//const TString RadiatorVolumeMedium    = "polypropylene";
-//const TString ElectronicsVolumeMedium = "goldcoatedcopper";
-
-// some global variables
-TGeoManager* gGeoMan = NULL;           // Pointer to TGeoManager instance
-TGeoVolume* gModules[NofModuleTypes];  // Global storage for module types
-
-// Forward declarations
-void create_materials_from_media_file();
-TGeoVolume* create_trd_module_type(Int_t moduleType);
-TGeoVolume* create_trd2d_module_type(Int_t moduleType);
-void create_detector_layers(Int_t layer);
-void create_gibbet_support();
-void create_power_bars_vertical();
-void create_power_bars_horizontal();
-void create_xtru_supports();
-void create_box_supports();
-void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-void create_mag_field_vector();
-void dump_info_file();
-void dump_digi_file();
-
-
-void Create_TRD_Geometry_v22f()
-{
-  // Load FairRunSim to ensure the correct unit system
-  FairRunSim* sim = new FairRunSim();
-
-  // declare TRD layer layout
-  if (setupid > 2)
-    for (Int_t i = 0; i < MaxLayers; i++)
-      ShowLayer[i] = 1;  // show all layers
-
-  // Load needed material definition from media.geo file
-  create_materials_from_media_file();
-
-  // Position the layers in z
-  LayerPosition[0] = -54;
-  for (Int_t iLayer = 1; iLayer < MaxLayers; iLayer++)
-    LayerPosition[iLayer] =
-      LayerPosition[iLayer - 1] + LayerThickness + LayerOffset[iLayer];  // add offset for extra gaps
-
-  // Get the GeoManager for later usage
-  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
-  gGeoMan->SetVisLevel(10);
-
-  // Create the top volume
-  TGeoBBox* topbox = new TGeoBBox("", 1000., 1000., 2000.);
-  TGeoVolume* top  = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
-  gGeoMan->SetTopVolume(top);
-
-  TGeoVolume* trd = new TGeoVolumeAssembly(geoVersion);
-  top->AddNode(trd, 1);
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    Int_t moduleType  = iModule + 1;
-    gModules[iModule] = (iModule >= 8 ? create_trd2d_module_type(moduleType) : create_trd_module_type(moduleType));
-  }
-
-  Int_t nLayer = 0;  // active layer counter
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    //    if ((iLayer != 0) && (iLayer != 3))  continue;  // first layer only - comment later on
-    //    if (iLayer != 0) continue;  // first layer only - comment later on
-    if (ShowLayer[iLayer]) {
-      PlaneId[iLayer] = ++nLayer;
-      create_detector_layers(iLayer);
-      //      printf("calling layer %2d\n",iLayer);
-    }
-  }
-
-  // TODO: remove or comment out
-  // test PlaneId
-  printf("generated TRD layers: ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) printf(" %2d", PlaneId[iLayer]);
-  printf("\n");
-
-  if (IncludeSupports) { create_box_supports(); }
-
-  if (IncludeGibbet) { create_gibbet_support(); }
-
-  if (IncludePowerbars) {
-    create_power_bars_vertical();
-    create_power_bars_horizontal();
-  }
-
-  if (IncludeFieldVector) create_mag_field_vector();
-
-  gGeoMan->CloseGeometry();
-  gGeoMan->CheckOverlaps(0.001);
-  gGeoMan->PrintOverlaps();
-  gGeoMan->Test();
-
-  trd->Export(FileNameSim);  // an alternative way of writing the trd volume
-
-  TFile* outfile = new TFile(FileNameSim, "UPDATE");
-  TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]);
-  trd_placement->Write();
-  outfile->Close();
-
-  outfile = new TFile(FileNameGeo, "RECREATE");
-  gGeoMan->Write();  // use this is you want GeoManager format in the output
-  outfile->Close();
-
-  dump_info_file();
-  dump_digi_file();
-
-  top->Draw("ogl");
-
-  //top->Raytrace();
-
-  //  cout << "Press Return to exit" << endl;
-  //  cin.get();
-  //  exit();
-
-  // create medialist for this geometry                                                                   
-  TString createmedialist = gSystem->Getenv("VMCWORKDIR");
-  createmedialist += "/macro/geometry/create_medialist.C";
-  std::cout << "Loading macro " << createmedialist << std::endl;
-  gROOT->LoadMacro(createmedialist);
-  gROOT->ProcessLine("create_medialist(\"\", false)");
-}
-
-
-//==============================================================
-void dump_digi_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  const Double_t ActiveAreaX[4] = {DetectorSizeX[0] - 2 * FrameWidth[0], DetectorSizeX[1] - 2 * FrameWidth[1],
-                                   DetectorSizeX[2] - 2 * FrameWidth[2], DetectorSizeX[3] - 2 * FrameWidth[3]};
-  const Double_t ActiveAreaY[4] = {DetectorSizeY[0] - 2 * FrameWidth[0], DetectorSizeY[1] - 2 * FrameWidth[1],
-                                   DetectorSizeY[2] - 2 * FrameWidth[2], DetectorSizeY[3] - 2 * FrameWidth[3]};
-  const Int_t NofSectors        = 3;
-  const Int_t NofPadsInRow[4]   = {80, 128, 72, 32};  // number of pads in rows
-  Int_t nrow                    = 0;                  // number of rows in module
-
-  const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-    {{1.50, 1.50, 1.50},                                          // module type 1 -  1.01 mm2
-     {2.25, 2.25, 2.25},                                          // module type 2 -  1.52 mm2
-     //          {  2.75,  2.50,  2.75 },   // module type 2 -  1.86 mm2
-     {4.50, 4.50, 4.50},  // module type 3 -  3.04 mm2
-     //          {  2.75,  6.75,  6.75 },   // module type 4 -  4.56 mm2
-     {2.79, 2.79, 2.79},  // module type 4 -  triangular pads H=27.7+0.2 mm, W=7.3+0.2 mm
-
-     {3.75, 4.00, 3.75},     // module type 5 -  2.84 mm2
-     {5.75, 5.75, 5.75},     // module type 6 -  4.13 mm2
-     {11.50, 11.50, 11.50},  // module type 7 -  8.26 mm2
-     {15.25, 15.50, 15.25},  // module type 8 - 11.14 mm2
-     // TRD2D with triangular pads
-     {2.79, 2.79, 2.79},   // module type 9 -  H=27.7+0.2 mm, W=7.3+0.2 mm
-     {2.72, 2.72, 2.72}};  // module type 10 - H=27.7+0.2 mm, W=7.3+0.2 mm
-  //          { 23.00, 23.00, 23.00 } };     // module type 8 - 16.52 mm2
-  //          {  7.50,  7.75,  7.50 },   // module type 6 -  5.51 mm2
-  //          {  5.50,  5.75,  5.50 },   // module type 6 -  4.09 mm2
-  //          { 11.25, 11.50, 11.25 },   // module type 7 -  8.18 mm2
-
-  const Int_t NofRowsInSector[NofModuleTypes][NofSectors] =  // number of rows per sector
-    {{12, 12, 12},                                           // module type 1
-     {8, 8, 8},                                              // module type 2
-     //          {   8,   4,   8 },         // module type 2
-     {4, 4, 4},   // module type 3
-                  //          {   2,   4,   2 },         // module type 4
-     {2, 16, 2},  // module type 4
-
-     {8, 8, 8},   // module type 5
-     {4, 8, 4},   // module type 6
-     {2, 4, 2},   // module type 7
-     {2, 2, 2},   // module type 8
-                  //          {   1,   2,   1 } };       // module type 8
-                  //          {  10,   4,  10 },         // module type 5
-                  //          {   4,   4,   4 },         // module type 6
-                  //          {   2,  12,   2 },         // module type 6
-                  //          {   2,   4,   2 },         // module type 7
-                  //          {   2,   2,   2 } };       // module type 8
-     {1, 18, 1},  // module type 9
-     {1, 1, 1}};  // module type 10
-
-  Double_t HeightOfSector[NofModuleTypes][NofSectors];
-  Double_t PadWidth[NofModuleTypes];
-
-  // calculate pad width
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    PadWidth[im] = ActiveAreaX[ModuleType[im]] / NofPadsInRow[ModuleType[im]];
-
-  // calculate height of sectors
-  for (Int_t im = 0; im < NofModuleTypes; im++)
-    for (Int_t is = 0; is < NofSectors; is++)
-      HeightOfSector[im][is] = NofRowsInSector[im][is] * PadHeightInSector[im][is];
-
-  // check, if the entire module size is covered by pads
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im != 3
-        && ActiveAreaY[ModuleType[im]] - (HeightOfSector[im][0] + HeightOfSector[im][1] + HeightOfSector[im][2]) != 0) {
-      printf("WARNING: sector size does not add up to module size for module "
-             "type %d\n",
-             im + 1);
-      printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaY[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1],
-             HeightOfSector[im][2]);
-      //exit(1);
-    }
-  }
-  //==============================================================
-
-  printf("writing trd pad information file: %s\n", FileNamePads.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNamePads.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNamePads.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "//   TRD pad layout for geometry %s\n", tagVersion.Data());
-  fprintf(ifile, "//\n");
-  fprintf(ifile, "// automatically generated by Create_TRD_Geometry_%s%s.C\n", tagVersion.Data(), subVersion.Data());
-  fprintf(ifile, "// created %d\n", datetime.GetDate());
-  fprintf(ifile, "//\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "#ifndef CBMTRDPADS_H\n");
-  fprintf(ifile, "#define CBMTRDPADS_H\n");
-  fprintf(ifile, "\n");
-  fprintf(ifile, "Int_t fst1_sect_count = 3;\n");
-  fprintf(ifile, "// array of pad geometries in the TRD (trd1mod[1-%d])\n", NofModuleTypes);
-  fprintf(ifile, "// %d modules  // 3 sectors  // 4 values \n", NofModuleTypes);
-  fprintf(ifile, "Float_t fst1_pad_type[%d][3][4] =        \n", NofModuleTypes);
-  //fprintf(ifile,"Double_t fst1_pad_type[8][3][4] =       \n");
-  fprintf(ifile, "			 		 \n");
-
-  for (Int_t im = 0; im < NofModuleTypes; im++) {
-    if (im + 1 == 5) fprintf(ifile, "//---\n\n");
-    fprintf(ifile, "// module type %d\n", im + 1);
-
-    // number of pads
-    nrow = 0;  // reset number of pad rows to 0
-    for (Int_t is = 0; is < NofSectors; is++)
-      nrow += HeightOfSector[im][is] / PadHeightInSector[im][is];  // add number of rows in this sector
-    fprintf(ifile, "// number of pads: %3d x %2d = %4d\n", NofPadsInRow[ModuleType[im]], nrow,
-            NofPadsInRow[ModuleType[im]] * nrow);
-
-    // pad size
-    fprintf(ifile, "// pad size sector 1: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][1],
-            PadWidth[im] * PadHeightInSector[im][1]);
-    fprintf(ifile, "// pad size sector 0: %5.2f cm x %5.2f cm = %5.2f cm2\n", PadWidth[im], PadHeightInSector[im][0],
-            PadWidth[im] * PadHeightInSector[im][0]);
-
-    for (Int_t is = 0; is < NofSectors; is++) {
-      if ((im == 0) && (is == 0)) fprintf(ifile, "  { { ");
-      else if (is == 0)
-        fprintf(ifile, "    { ");
-      else
-        fprintf(ifile, "      ");
-
-      fprintf(ifile, "{ %.2f, %5.2f, %.2f/%3d, %5.2f }", ActiveAreaX[ModuleType[im]], HeightOfSector[im][is],
-              ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][is]);
-
-      if ((im == NofModuleTypes - 1) && (is == 2)) fprintf(ifile, " } };");
-      else if (is == 2)
-        fprintf(ifile, " },");
-      else
-        fprintf(ifile, ",");
-
-      fprintf(ifile, "\n");
-    }
-
-    fprintf(ifile, "\n");
-  }
-
-  fprintf(ifile, "#endif\n");
-
-  //  Int_t im = 0;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"  { { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-  //
-  //  for (Int_t im = 1; im < NofModuleTypes-1; im++)
-  //  {
-  //    fprintf(ifile,"// module type %d	 		     \n", im+1);
-  //    fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //    fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } },  \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //    fprintf(ifile,"\n");
-  //  }
-  //
-  //  Int_t im = 7;
-  //  fprintf(ifile,"// module type %d	 		   \n", im+1);
-  //  fprintf(ifile,"    { { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][0]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f },    \n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][1], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][1]);
-  //  fprintf(ifile,"      { %.1f, %5.2f, %.1f/%3d, %5.2f } } };\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][2], ActiveAreaX[ModuleType[im]], NofPadsInRow[ModuleType[im]], PadHeightInSector[im][2]);
-  //  fprintf(ifile,"\n");
-
-  fclose(ifile);
-}
-
-
-void dump_info_file()
-{
-  TDatime datetime;  // used to get timestamp
-
-  Double_t z_first_layer = 2000;  // z position of first layer (front)
-  Double_t z_last_layer  = 0;     // z position of last  layer (front)
-
-  Double_t xangle;  // horizontal angle
-  Double_t yangle;  // vertical   angle
-
-  Double_t total_surface = 0;  // total surface
-  Double_t total_actarea = 0;  // total active area
-
-  Int_t channels_per_module[NofModuleTypes + 1] = {0};  // number of channels per module
-  Int_t channels_per_feb[NofModuleTypes + 1]    = {0};  // number of channels per feb
-  Int_t asics_per_module[NofModuleTypes + 1]    = {0};  // number of asics per module
-
-  Int_t total_modules[NofModuleTypes + 1]  = {0};  // total number of modules
-  Int_t total_febs[NofModuleTypes + 1]     = {0};  // total number of febs
-  Int_t total_asics[NofModuleTypes + 1]    = {0};  // total number of asics
-  Int_t total_gbtx[NofModuleTypes + 1]     = {0};  // total number of gbtx
-  Int_t total_rob3[NofModuleTypes + 1]     = {0};  // total number of gbtx rob3
-  Int_t total_rob5[NofModuleTypes + 1]     = {0};  // total number of gbtx rob5
-  Int_t total_rob7[NofModuleTypes + 1]     = {0};  // total number of gbtx rob7
-  Int_t total_channels[NofModuleTypes + 1] = {0};  // total number of channels
-
-  Int_t total_channels_u = 0;  // total number of ultimate channels
-  Int_t total_channels_s = 0;  // total number of super    channels
-  Int_t total_channels_r = 0;  // total number of regular  channels
-
-  printf("writing summary information file: %s\n", FileNameInfo.Data());
-
-  FILE* ifile;
-  ifile = fopen(FileNameInfo.Data(), "w");
-
-  if (ifile == NULL) {
-    printf("error opening %s\n", FileNameInfo.Data());
-    exit(1);
-  }
-
-  fprintf(ifile, "#\n##   %s information file\n#\n\n", geoVersion.Data());
-
-  fprintf(ifile, "# created %d\n\n", datetime.GetDate());
-
-  // determine first and last TRD layer
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) {
-      if (z_first_layer > LayerPosition[iLayer]) z_first_layer = LayerPosition[iLayer];
-      if (z_last_layer < LayerPosition[iLayer]) z_last_layer = LayerPosition[iLayer];
-    }
-  }
-
-  fprintf(ifile, "# envelope\n");
-  // Show extension of TRD
-  fprintf(ifile, "%4f cm   start of TRD (z)\n", z_first_layer);
-  fprintf(ifile, "%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Layer thickness
-  fprintf(ifile, "# thickness\n");
-  fprintf(ifile, "%4f cm   per single layer (z)\n", LayerThickness);
-  fprintf(ifile, "\n");
-
-  // Show extra gaps
-  fprintf(ifile, "# extra gaps\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%3f ", LayerOffset[iLayer]);
-  fprintf(ifile, "   extra gaps in z (cm)\n");
-  fprintf(ifile, "\n");
-
-  // Show layer flags
-  fprintf(ifile, "# generated TRD layers\n ");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) fprintf(ifile, "%2d ", PlaneId[iLayer]);
-  fprintf(ifile, "   planeID\n");
-  fprintf(ifile, "\n");
-
-  // Dimensions in x
-  fprintf(ifile, "# dimensions in x\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[type],
-                3.5 * DetectorSizeX[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Dimensions in y
-  fprintf(ifile, "# dimensions in y\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (PlaneId[iLayer] <= 5) {
-        Int_t type = LayerType[iLayer] / 10;
-        fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[type],
-                2.5 * DetectorSizeY[type], PlaneId[iLayer]);
-      }
-      else {
-        if (PlaneId[iLayer] < 9)
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-        else
-          fprintf(ifile, "%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                  PlaneId[iLayer]);
-      }
-    }
-  fprintf(ifile, "\n");
-
-  // Show layer positions
-  fprintf(ifile, "# z-positions of layer front\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++) {
-    if (ShowLayer[iLayer]) fprintf(ifile, "%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-  }
-  fprintf(ifile, "\n");
-
-  // flags
-  fprintf(ifile, "# flags\n");
-
-  fprintf(ifile, "support structure is    : ");
-  if (!IncludeSupports) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "radiator is             : ");
-  if (!IncludeRadiator) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "lattice grid is         : ");
-  if (!IncludeLattice) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "kapton window is        : ");
-  if (!IncludeKaptonFoil) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "gas frame is            : ");
-  if (!IncludeGasFrame) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "padplane is             : ");
-  if (!IncludePadplane) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "backpanel is            : ");
-  if (!IncludeBackpanel) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Aluminium ledge is      : ");
-  if (!IncludeAluLedge) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Gibbet support is       : ");
-  if (!IncludeGibbet) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "Power bus bars are      : ");
-  if (!IncludePowerbars) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "asics are               : ");
-  if (!IncludeAsics) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "front-end boards are    : ");
-  if (!IncludeFebs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "GBTX readout boards are : ");
-  if (!IncludeRobs) fprintf(ifile, "NOT ");
-  fprintf(ifile, "included\n");
-
-  fprintf(ifile, "\n");
-
-
-  // module statistics
-  //  fprintf(ifile,"#\n##   modules\n#\n\n");
-  //  fprintf(ifile,"number of modules per type and layer:\n");
-  fprintf(ifile, "# modules\n");
-
-  for (Int_t iModule = 1; iModule <= NofModuleTypes; iModule++)
-    fprintf(ifile, "     mod%1d", iModule);
-  fprintf(ifile, "    total");
-
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-        fprintf(ifile, " %8d", ModuleStats[iLayer][iModule]);
-        total_modules[iModule] += ModuleStats[iLayer][iModule];  // sum up modules across layers
-      }
-      fprintf(ifile, "            layer %2d\n", PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n------------------------------------------------------------------"
-                 "---------------\n");
-
-  // total statistics
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", total_modules[iModule]);
-    total_modules[NofModuleTypes] += total_modules[iModule];
-  }
-  fprintf(ifile, " %8d", total_modules[NofModuleTypes]);
-  fprintf(ifile, "   number of modules\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of FEBs
-  //  fprintf(ifile,"\n#\n##   febs\n#\n\n");
-  fprintf(ifile, "# febs\n");
-
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) fprintf(ifile, "%8du", FebsPerModule[iModule]);
-    else if ((AsicsPerFeb[iModule] / 100) == 2)
-      fprintf(ifile, "%8ds", FebsPerModule[iModule]);
-    else
-      fprintf(ifile, "%8d ", FebsPerModule[iModule]);
-  }
-  fprintf(ifile, "           FEBs per module\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 3) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8du", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   ultimate  FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 2) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8ds", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   super     FEBs\n");
-
-  // FEB total per type
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 1) {
-      total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-      fprintf(ifile, "%8d ", total_febs[iModule]);
-      total_febs[NofModuleTypes] += total_febs[iModule];
-    }
-    else
-      fprintf(ifile, "         ");
-  }
-  fprintf(ifile, "%8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   regular   FEBs\n");
-
-  // FEB total over all types
-  total_febs[NofModuleTypes] = 0;  // reset sum to 0
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_febs[iModule] = total_modules[iModule] * FebsPerModule[iModule];
-    fprintf(ifile, " %8d", total_febs[iModule]);
-    total_febs[NofModuleTypes] += total_febs[iModule];
-  }
-  fprintf(ifile, " %8d", total_febs[NofModuleTypes]);
-  fprintf(ifile, "   number of FEBs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of ASICs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# asics\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", AsicsPerFeb[iModule] % 100);
-  }
-  fprintf(ifile, "            ASICs per FEB\n");
-
-  // ASICs per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    asics_per_module[iModule] = FebsPerModule[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", asics_per_module[iModule]);
-  }
-  fprintf(ifile, "            ASICs per module\n");
-
-  // ASICs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_asics[iModule] = total_febs[iModule] * (AsicsPerFeb[iModule] % 100);
-    fprintf(ifile, " %8d", total_asics[iModule]);
-    total_asics[NofModuleTypes] += total_asics[iModule];
-  }
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes]);
-  fprintf(ifile, "   number of ASICs\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of GBTXs
-  //  fprintf(ifile,"\n#\n##   asics\n#\n\n");
-  fprintf(ifile, "# gbtx\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", GbtxPerModule[iModule]);
-  }
-  fprintf(ifile, "            GBTXs per module\n");
-
-  // GBTXs per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_gbtx[iModule] = total_modules[iModule] * GbtxPerModule[iModule];
-    fprintf(ifile, " %8d", total_gbtx[iModule]);
-    total_gbtx[NofModuleTypes] += total_gbtx[iModule];
-  }
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTXs\n");
-
-  // GBTX ROB types per module type
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    fprintf(ifile, " %8d", RobTypeOnModule[iModule]);
-  }
-  fprintf(ifile, "            GBTX ROB types on module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((RobTypeOnModule[iModule] % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 7) total_rob7[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 7) total_rob7[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 5) total_rob5[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100) == 5) total_rob5[iModule]++;
-
-    if ((RobTypeOnModule[iModule] % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 1000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 10000 % 10) == 3) total_rob3[iModule]++;
-    if ((RobTypeOnModule[iModule] / 100000) == 3) total_rob3[iModule]++;
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob7[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob7[iModule]);
-    total_rob7[NofModuleTypes] += total_rob7[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob7[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB7\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob5[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob5[iModule]);
-    total_rob5[NofModuleTypes] += total_rob5[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob5[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB5\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_rob3[iModule] *= total_modules[iModule];
-    fprintf(ifile, " %8d", total_rob3[iModule]);
-    total_rob3[NofModuleTypes] += total_rob3[iModule];
-  }
-  fprintf(ifile, " %8d", total_rob3[NofModuleTypes]);
-  fprintf(ifile, "   number of GBTX ROB3\n");
-
-  //------------------------------------------------------------------------------
-  fprintf(ifile, "# e-links\n");
-
-  // e-links used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", asics_per_module[iModule] * 2);
-  fprintf(ifile, " %8d", total_asics[NofModuleTypes] * 2);
-  fprintf(ifile, "   e-links used\n");
-
-  // e-links available
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", GbtxPerModule[iModule] * 14);
-  fprintf(ifile, " %8d", total_gbtx[NofModuleTypes] * 14);
-  fprintf(ifile, "   e-links available\n");
-
-  // e-link efficiency
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if (total_gbtx[iModule] != 0)
-      fprintf(ifile, " %7.1f%%", (float) total_asics[iModule] * 2 / (total_gbtx[iModule] * 14) * 100);
-    else
-      fprintf(ifile, "        -");
-  }
-  if (total_gbtx[NofModuleTypes] != 0)
-    fprintf(ifile, " %7.1f%%", (float) total_asics[NofModuleTypes] * 2 / (total_gbtx[NofModuleTypes] * 14) * 100);
-  fprintf(ifile, "   e-link efficiency\n\n");
-
-  //------------------------------------------------------------------------------
-
-  // number of channels
-  fprintf(ifile, "# channels\n");
-
-  // channels per module
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] % 100) == 16) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows  // 84, if 63 of 64 ch used
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 15) {
-      channels_per_feb[iModule]    = 80 * 6;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 10) {
-      //      channels_per_feb[iModule] =  80 * 4;   // rows
-      channels_per_feb[iModule]    = (AsicsPerFeb[iModule] % 100) * 16;  // electronic channels
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-    if ((AsicsPerFeb[iModule] % 100) == 5) {
-      channels_per_feb[iModule]    = 80 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-
-    if ((AsicsPerFeb[iModule] % 100) == 8) {
-      channels_per_feb[iModule]    = 128 * 2;  // rows
-      channels_per_module[iModule] = channels_per_feb[iModule] * FebsPerModule[iModule];
-    }
-  }
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_module[iModule]);
-  fprintf(ifile, "            channels per module\n");
-
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    fprintf(ifile, " %8d", channels_per_feb[iModule]);
-  fprintf(ifile, "            channels per feb\n");
-
-  // channels used
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    total_channels[iModule] = channels_per_module[iModule] * total_modules[iModule];
-    fprintf(ifile, " %8d", total_channels[iModule]);
-    total_channels[NofModuleTypes] += total_channels[iModule];
-  }
-  fprintf(ifile, " %8d", total_channels[NofModuleTypes]);
-  fprintf(ifile, "   channels used\n");
-
-  // channels available
-  fprintf(ifile, " ");
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++) {
-    if ((AsicsPerFeb[iModule] / 100) == 4)  // FASP case
-    {
-      fprintf(ifile, "%8dF", total_asics[iModule] * 16);
-      total_channels_u += total_asics[iModule] * 16;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 3) {
-      fprintf(ifile, "%8du", total_asics[iModule] * 32);
-      total_channels_u += total_asics[iModule] * 32;
-    }
-    else if ((AsicsPerFeb[iModule] / 100) == 2) {
-      fprintf(ifile, "%8ds", total_asics[iModule] * 32);
-      total_channels_s += total_asics[iModule] * 32;
-    }
-    else {
-      fprintf(ifile, "%8d ", total_asics[iModule] * 32);
-      total_channels_r += total_asics[iModule] * 32;
-    }
-  }
-  fprintf(ifile, "%8d", total_asics[NofModuleTypes] * 32);
-  fprintf(ifile, "   channels available\n");
-
-  // channel ratio for u,s,r density
-  fprintf(ifile, " ");
-  fprintf(ifile, "%7.1f%%u", (float) total_channels_u / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%s", (float) total_channels_s / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "%7.1f%%r", (float) total_channels_r / (total_asics[NofModuleTypes] * 32) * 100);
-  fprintf(ifile, "                                                        channel ratio\n");
-
-  fprintf(ifile, "\n");
-  fprintf(ifile, "%8.1f%%   channel efficiency\n",
-          1. * total_channels[NofModuleTypes] / (total_asics[NofModuleTypes] * 32) * 100);
-
-  //------------------------------------------------------------------------------
-
-  // total surface of TRD
-  for (Int_t iModule = 0; iModule < NofModuleTypes; iModule++)
-    if (iModule <= 3) {
-      total_surface += total_modules[iModule] * DetectorSizeX[0] / 100 * DetectorSizeY[0] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[0] - 2 * FrameWidth[0]) / 100
-                       * (DetectorSizeY[0] - 2 * FrameWidth[0]) / 100;
-    }
-    else {
-      total_surface += total_modules[iModule] * DetectorSizeX[1] / 100 * DetectorSizeY[1] / 100;
-      total_actarea += total_modules[iModule] * (DetectorSizeX[1] - 2 * FrameWidth[1]) / 100
-                       * (DetectorSizeY[1] - 2 * FrameWidth[1]) / 100;
-    }
-  fprintf(ifile, "\n");
-
-  // summary
-  fprintf(ifile, "%7.2f m2      total surface    \n", total_surface);
-  fprintf(ifile, "%7.2f m2      total active area\n", total_actarea);
-  fprintf(ifile, "%7.2f m3      total gas volume \n",
-          total_actarea * gas_thickness / 100);  // convert cm to m for thickness
-
-  fprintf(ifile, "%7.2f cm2/ch  average channel size\n", 100. * 100 * total_actarea / total_channels[NofModuleTypes]);
-  fprintf(ifile, "%7.2f ch/m2   channels per m2 active area\n", 1. * total_channels[NofModuleTypes] / total_actarea);
-  fprintf(ifile, "\n");
-
-  // gas volume position
-  fprintf(ifile, "# gas volume position\n");
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer])
-      fprintf(ifile, "%10.4f cm   position of gas volume - layer %2d\n",
-              LayerPosition[iLayer] + LayerThickness / 2. + gas_position, PlaneId[iLayer]);
-  fprintf(ifile, "\n");
-
-  // angles
-  fprintf(ifile, "# angles of acceptance\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        Int_t type(LayerType[iLayer] / 10);
-        yangle = atan(2.5 * DetectorSizeY[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-        xangle = atan(3.5 * DetectorSizeX[type] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position))
-                 * 180. / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(3.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(4.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(4.5 * DetectorSizeY[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(5.5 * DetectorSizeX[1] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  // aperture
-  fprintf(ifile, "# inner aperture\n");
-
-  for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    if (ShowLayer[iLayer]) {
-      if (iLayer <= 5) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 2.5 * DetectorSizeY[1], 3.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer > 5) && (iLayer < 8)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 3.5 * DetectorSizeY[1], 4.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      if ((iLayer >= 8) && (iLayer < 10)) {
-        //        fprintf(ifile,"y %10.4f cm   x %10.4f cm\n", 4.5 * DetectorSizeY[1], 5.5 * DetectorSizeX[1]);
-        yangle = atan(0.5 * DetectorSizeY[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-        xangle = atan(0.5 * DetectorSizeX[0] / (LayerPosition[iLayer] + LayerThickness / 2. + padplane_position)) * 180.
-                 / acos(-1.);
-      }
-      fprintf(ifile, "v: %5.2f deg, h: %5.2f deg - vertical/horizontal - layer %2d\n", yangle, xangle, PlaneId[iLayer]);
-    }
-  fprintf(ifile, "\n");
-
-  fclose(ifile);
-}
-
-
-void create_materials_from_media_file()
-{
-  // Use the FairRoot geometry interface to load the media which are already defined
-  FairGeoLoader* geoLoad    = new FairGeoLoader("TGeo", "FairGeoLoader");
-  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
-  TString geoPath           = gSystem->Getenv("VMCWORKDIR");
-  TString medFile           = geoPath + "/geometry/media.geo";
-  geoFace->setMediaFile(medFile);
-  geoFace->readMedia();
-
-  // Read the required media and create them in the GeoManager
-  FairGeoMedia* geoMedia   = geoFace->getMedia();
-  FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
-
-  FairGeoMedium* air       = geoMedia->getMedium(KeepingVolumeMedium);
-  FairGeoMedium* pefoam20  = geoMedia->getMedium(RadiatorVolumeMedium);
-  FairGeoMedium* G10       = geoMedia->getMedium(LatticeVolumeMedium);
-  FairGeoMedium* kapton    = geoMedia->getMedium(KaptonVolumeMedium);
-  FairGeoMedium* trdGas    = geoMedia->getMedium(GasVolumeMedium);
-  FairGeoMedium* copper    = geoMedia->getMedium(PadCopperVolumeMedium);
-  FairGeoMedium* carbon    = geoMedia->getMedium(CarbonVolumeMedium);
-  FairGeoMedium* honeycomb = geoMedia->getMedium(HoneycombVolumeMedium);
-  FairGeoMedium* aluminium = geoMedia->getMedium(AluminiumVolumeMedium);
-
-  FairGeoMedium* KANYAProfile10x10Strong = geoMedia->getMedium(Kanya10x10sVolumeMedium);
-  FairGeoMedium* KANYAProfile10x10Normal = geoMedia->getMedium(Kanya10x10nVolumeMedium);
-  FairGeoMedium* KANYAProfile3x5Normal   = geoMedia->getMedium(Kanya03x05nVolumeMedium);
-
-  //  FairGeoMedium* goldCoatedCopper = geoMedia->getMedium("goldcoatedcopper");
-  //  FairGeoMedium* polypropylene    = geoMedia->getMedium("polypropylene");
-  //  FairGeoMedium* mylar            = geoMedia->getMedium("mylar");
-
-  geoBuild->createMedium(air);
-  geoBuild->createMedium(pefoam20);
-  geoBuild->createMedium(trdGas);
-  geoBuild->createMedium(honeycomb);
-  geoBuild->createMedium(carbon);
-  geoBuild->createMedium(G10);
-  geoBuild->createMedium(copper);
-  geoBuild->createMedium(kapton);
-  geoBuild->createMedium(aluminium);
-
-  geoBuild->createMedium(KANYAProfile10x10Strong);
-  geoBuild->createMedium(KANYAProfile10x10Normal);
-  geoBuild->createMedium(KANYAProfile3x5Normal);
-
-  //  geoBuild->createMedium(goldCoatedCopper);
-  //  geoBuild->createMedium(polypropylene);
-  //  geoBuild->createMedium(mylar);
-}
-
-TGeoVolume* create_trd_module_type(Int_t moduleType)
-{
-  Int_t type           = ModuleType[moduleType - 1];
-  Double_t sizeX       = DetectorSizeX[type];
-  Double_t sizeY       = DetectorSizeY[type];
-  Double_t frameWidth  = FrameWidth[type];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed    = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* aluledgeVolMed = gGeoMan->GetMedium(AluLegdeVolumeMedium);
-  TGeoMedium* febVolMed      = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed     = gGeoMan->GetMedium(AsicVolumeMedium);
-  //  TGeoMedium* aluminiumVolMed   = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {
-    // Radiator
-    //   TGeoBBox* trd_radiator = new TGeoBBox("", activeAreaX /2., activeAreaY /2., radiator_thickness /2.);
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("radiator", trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("module%d_radiator", moduleType), trd_radiator, radVolMed);
-    //     TGeoVolume* trdmod1_radvol = new TGeoVolume(Form("trd1mod%dradiator", moduleType), trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kBlue);
-    trdmod1_radvol->SetTransparency(70);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  // Lattice grid
-  if (IncludeLattice) {
-
-    if (type == 0)  // inner modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod0_ho = new TGeoBBox("trd_lattice_mod0_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod0_hi =
-        new TGeoBBox("trd_lattice_mod0_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod0_vo =
-        new TGeoBBox("trd_lattice_mod0_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod0_vi = new TGeoBBox("trd_lattice_mod0_vi", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod0_vb = new TGeoBBox("trd_lattice_mod0_vb", lattice_i_width[type] / 2.,
-                                                   0.20 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod0_vol_ho = new TGeoVolume("lattice0ho", trd_lattice_mod0_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_hi = new TGeoVolume("lattice0hi", trd_lattice_mod0_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vo = new TGeoVolume("lattice0vo", trd_lattice_mod0_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vi = new TGeoVolume("lattice0vi", trd_lattice_mod0_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod0_vol_vb = new TGeoVolume("lattice0vb", trd_lattice_mod0_vb, latticeVolMed);
-
-      trd_lattice_mod0_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod0_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod0_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod0_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod0_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv010 =
-        new TGeoTranslation("tv010", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv015 =
-        new TGeoTranslation("tv015", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th020 =
-        new TGeoTranslation("th020", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th025 =
-        new TGeoTranslation("th025", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos0[4] = {(0.60 * activeAreaY / 2.), (0.20 * activeAreaY / 2.), -(0.20 * activeAreaY / 2.),
-                            -(0.60 * activeAreaY / 2.)};
-
-      Double_t vxpos0[4] = {(0.60 * activeAreaX / 2.), (0.20 * activeAreaX / 2.), -(0.20 * activeAreaX / 2.),
-                            -(0.60 * activeAreaX / 2.)};
-
-      Double_t vypos0[5] = {(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.), (0.40 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.40 * activeAreaY / 2.),
-                            -(0.80 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod0_lattice = new TGeoVolumeAssembly("mod0lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod0  = new TGeoBBox("trd_lattice_mod0", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod0_lattice = new TGeoVolume("lat_grid_mod0", trd_lattice_mod0, keepVolMed);
-
-      //       trdmod0_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 1, tv010);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_ho, 2, tv015);
-
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 3, th020);
-      trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vo, 4, th025);
-
-      // lattice piece number
-      Int_t lat0_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 4; y++) {
-        TGeoTranslation* t0xy = new TGeoTranslation("", 0, hypos0[y], 0);
-        trdmod0_lattice->AddNode(trd_lattice_mod0_vol_hi, lat0_no, t0xy);
-        lat0_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 4; x++)
-        for (Int_t y = 0; y < 5; y++) {
-          TGeoTranslation* t0xy = new TGeoTranslation("", vxpos0[x], vypos0[y], 0);
-          if ((y == 0) || (y == 4)) trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vb, lat0_no, t0xy);  // border piece
-          else
-            trdmod0_lattice->AddNode(trd_lattice_mod0_vol_vi, lat0_no, t0xy);  // middle piece
-          lat0_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod0_lattice, 1, trd_lattice_trans);
-    }
-
-    else if (type == 1)  // outer modules
-    {
-      //     printf("lattice type %d\n", type);
-      // drift window - lattice grid - sprossenfenster
-      TGeoBBox* trd_lattice_mod1_ho = new TGeoBBox("trd_lattice_mod1_ho", sizeX / 2., lattice_o_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // horizontal outer
-      TGeoBBox* trd_lattice_mod1_hi =
-        new TGeoBBox("trd_lattice_mod1_hi", sizeX / 2. - lattice_o_width[type], lattice_i_width[type] / 2.,
-                     lattice_thickness / 2.);  // horizontal inner
-      TGeoBBox* trd_lattice_mod1_vo =
-        new TGeoBBox("trd_lattice_mod1_vo", lattice_o_width[type] / 2., sizeX / 2. - lattice_o_width[type],
-                     lattice_thickness / 2.);  // vertical outer
-      TGeoBBox* trd_lattice_mod1_vi = new TGeoBBox("trd_lattice_mod1_vi", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 2.,
-                                                   lattice_thickness / 2.);  // vertical inner
-      TGeoBBox* trd_lattice_mod1_vb = new TGeoBBox("trd_lattice_mod1_vb", lattice_i_width[type] / 2.,
-                                                   0.125 * activeAreaY / 2. - lattice_i_width[type] / 4.,
-                                                   lattice_thickness / 2.);  // vertical border
-
-      TGeoVolume* trd_lattice_mod1_vol_ho = new TGeoVolume("lattice1ho", trd_lattice_mod1_ho, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_hi = new TGeoVolume("lattice1hi", trd_lattice_mod1_hi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vo = new TGeoVolume("lattice1vo", trd_lattice_mod1_vo, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vi = new TGeoVolume("lattice1vi", trd_lattice_mod1_vi, latticeVolMed);
-      TGeoVolume* trd_lattice_mod1_vol_vb = new TGeoVolume("lattice1vb", trd_lattice_mod1_vb, latticeVolMed);
-
-      trd_lattice_mod1_vol_ho->SetLineColor(kYellow);  // kBlue);
-      trd_lattice_mod1_vol_vo->SetLineColor(kYellow);  // kOrange);
-      trd_lattice_mod1_vol_hi->SetLineColor(kYellow);  // kRed);
-      trd_lattice_mod1_vol_vi->SetLineColor(kYellow);  // kWhite);
-      trd_lattice_mod1_vol_vb->SetLineColor(kYellow);
-
-      TGeoTranslation* tv110 =
-        new TGeoTranslation("tv110", 0., (1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-      TGeoTranslation* tv118 =
-        new TGeoTranslation("tv118", 0., -(1.00 * activeAreaY / 2. + lattice_o_width[type] / 2.), 0);
-
-      TGeoTranslation* th120 =
-        new TGeoTranslation("th120", (1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-      TGeoTranslation* th128 =
-        new TGeoTranslation("th128", -(1.00 * activeAreaX / 2. + lattice_o_width[type] / 2.), 0., 0);
-
-      Double_t hypos1[7] = {(0.75 * activeAreaY / 2.), (0.50 * activeAreaY / 2.),  (0.25 * activeAreaY / 2.),
-                            (0.00 * activeAreaY / 2.), -(0.25 * activeAreaY / 2.), -(0.50 * activeAreaY / 2.),
-                            -(0.75 * activeAreaY / 2.)};
-
-      Double_t vxpos1[7] = {(0.75 * activeAreaX / 2.), (0.50 * activeAreaX / 2.),  (0.25 * activeAreaX / 2.),
-                            (0.00 * activeAreaX / 2.), -(0.25 * activeAreaX / 2.), -(0.50 * activeAreaX / 2.),
-                            -(0.75 * activeAreaX / 2.)};
-
-      Double_t vypos1[8] = {(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.),
-                            (0.625 * activeAreaY / 2.),
-                            (0.375 * activeAreaY / 2.),
-                            (0.125 * activeAreaY / 2.),
-                            -(0.125 * activeAreaY / 2.),
-                            -(0.375 * activeAreaY / 2.),
-                            -(0.625 * activeAreaY / 2.),
-                            -(0.875 * activeAreaY / 2. + lattice_i_width[type] / 4.)};
-
-      //       TGeoVolumeAssembly* trdmod1_lattice = new TGeoVolumeAssembly("mod1lattice"); // volume for lattice grid
-
-      TGeoBBox* trd_lattice_mod1  = new TGeoBBox("trd_lattice_mod1", sizeX / 2., sizeY / 2., lattice_thickness / 2.);
-      TGeoVolume* trdmod1_lattice = new TGeoVolume("lat_grid_mod1", trd_lattice_mod1, keepVolMed);
-
-      //       trdmod1_lattice->SetLineColor(kGreen);  // set color for keeping volume
-
-      // outer frame
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 1, tv110);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_ho, 2, tv118);
-
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 3, th120);
-      trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vo, 4, th128);
-
-      // lattice piece number
-      Int_t lat1_no = 5;
-
-      // horizontal bars
-      for (Int_t y = 0; y < 7; y++) {
-        TGeoTranslation* t1xy = new TGeoTranslation("", 0, hypos1[y], 0);
-        trdmod1_lattice->AddNode(trd_lattice_mod1_vol_hi, lat1_no, t1xy);
-        lat1_no++;
-      }
-
-      // vertical bars
-      for (Int_t x = 0; x < 7; x++)
-        for (Int_t y = 0; y < 8; y++) {
-          TGeoTranslation* t1xy = new TGeoTranslation("", vxpos1[x], vypos1[y], 0);
-          if ((y == 0) || (y == 7)) trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vb, lat1_no, t1xy);  // border piece
-          else
-            trdmod1_lattice->AddNode(trd_lattice_mod1_vol_vi, lat1_no, t1xy);  // middle piece
-          lat1_no++;
-        }
-
-      // add lattice to module
-      TGeoTranslation* trd_lattice_trans = new TGeoTranslation("", 0., 0., lattice_position);
-      module->AddNode(trdmod1_lattice, 1, trd_lattice_trans);
-    }
-
-  }  // with lattice grid
-
-  if (IncludeKaptonFoil) {
-    // Kapton Foil
-    TGeoBBox* trd_kapton          = new TGeoBBox("trd_kapton", sizeX / 2., sizeY / 2., kapton_thickness / 2.);
-    TGeoVolume* trdmod1_kaptonvol = new TGeoVolume("kaptonfoil", trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("module%d_kaptonfoil", moduleType), trd_kapton, kaptonVolMed);
-    //   TGeoVolume* trdmod1_kaptonvol = new TGeoVolume(Form("trd1mod%dkapton", moduleType), trd_kapton, kaptonVolMed);
-    trdmod1_kaptonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_kapton_trans = new TGeoTranslation("", 0., 0., kapton_position);
-    module->AddNode(trdmod1_kaptonvol, 1, trd_kapton_trans);
-  }
-
-  // start of Frame in z
-  // Gas
-  TGeoBBox* trd_gas          = new TGeoBBox("trd_gas", activeAreaX / 2., activeAreaY / 2., gas_thickness / 2.);
-  TGeoVolume* trdmod1_gasvol = new TGeoVolume("gas", trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("module%d_gas", moduleType), trd_gas, gasVolMed);
-  //   TGeoVolume* trdmod1_gasvol = new TGeoVolume(Form("trd1mod%dgas", moduleType), trd_gas, gasVolMed);
-  //   trdmod1_gasvol->SetLineColor(kBlue);
-  trdmod1_gasvol->SetLineColor(kGreen);  // to avoid blue overlaps in the screenshots
-  trdmod1_gasvol->SetTransparency(40);   // set transparency for the TRD gas
-  TGeoTranslation* trd_gas_trans = new TGeoTranslation("", 0., 0., gas_position);
-  module->AddNode(trdmod1_gasvol, 1, trd_gas_trans);
-  // end of Frame in z
-
-  if (IncludeGasFrame) {
-    // frame1
-    TGeoBBox* trd_frame1          = new TGeoBBox("trd_frame1", sizeX / 2., frameWidth / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame1vol = new TGeoVolume("frame1", trd_frame1, frameVolMed);
-    trdmod1_frame1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame1_trans = new TGeoTranslation("", 0., activeAreaY / 2. + frameWidth / 2., frame_position);
-    module->AddNode(trdmod1_frame1vol, 1, trd_frame1_trans);
-    trd_frame1_trans = new TGeoTranslation("", 0., -(activeAreaY / 2. + frameWidth / 2.), frame_position);
-    module->AddNode(trdmod1_frame1vol, 2, trd_frame1_trans);
-
-
-    // frame2
-    TGeoBBox* trd_frame2          = new TGeoBBox("trd_frame2", frameWidth / 2., activeAreaY / 2., frame_thickness / 2.);
-    TGeoVolume* trdmod1_frame2vol = new TGeoVolume("frame2", trd_frame2, frameVolMed);
-    trdmod1_frame2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_frame2_trans = new TGeoTranslation("", activeAreaX / 2. + frameWidth / 2., 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 1, trd_frame2_trans);
-    trd_frame2_trans = new TGeoTranslation("", -(activeAreaX / 2. + frameWidth / 2.), 0., frame_position);
-    module->AddNode(trdmod1_frame2vol, 2, trd_frame2_trans);
-  }
-
-  if (IncludePadplane) {
-    // Pad Copper
-    TGeoBBox* trd_padcopper          = new TGeoBBox("trd_padcopper", sizeX / 2., sizeY / 2., padcopper_thickness / 2.);
-    TGeoVolume* trdmod1_padcoppervol = new TGeoVolume("padcopper", trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("module%d_padcopper", moduleType), trd_padcopper, padcopperVolMed);
-    //   TGeoVolume* trdmod1_padcoppervol = new TGeoVolume(Form("trd1mod%dpadcopper", moduleType), trd_padcopper, padcopperVolMed);
-    trdmod1_padcoppervol->SetLineColor(kOrange);
-    TGeoTranslation* trd_padcopper_trans = new TGeoTranslation("", 0., 0., padcopper_position);
-    module->AddNode(trdmod1_padcoppervol, 1, trd_padcopper_trans);
-
-    // Pad Plane
-    TGeoBBox* trd_padpcb          = new TGeoBBox("trd_padpcb", sizeX / 2., sizeY / 2., padplane_thickness / 2.);
-    TGeoVolume* trdmod1_padpcbvol = new TGeoVolume("padplane", trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("module%d_padplane", moduleType), trd_padpcb, padpcbVolMed);
-    //   TGeoVolume* trdmod1_padpcbvol = new TGeoVolume(Form("trd1mod%dpadplane", moduleType), trd_padpcb, padpcbVolMed);
-    trdmod1_padpcbvol->SetLineColor(kBlue);
-    TGeoTranslation* trd_padpcb_trans = new TGeoTranslation("", 0., 0., padplane_position);
-    module->AddNode(trdmod1_padpcbvol, 1, trd_padpcb_trans);
-  }
-
-  if (IncludeBackpanel) {
-    // Honeycomb
-    TGeoBBox* trd_honeycomb          = new TGeoBBox("trd_honeycomb", sizeX / 2., sizeY / 2., honeycomb_thickness / 2.);
-    TGeoVolume* trdmod1_honeycombvol = new TGeoVolume("honeycomb", trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("module%d_honeycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    //   TGeoVolume* trdmod1_honeycombvol = new TGeoVolume(Form("trd1mod%dhoneycomb", moduleType), trd_honeycomb, honeycombVolMed);
-    trdmod1_honeycombvol->SetLineColor(kOrange);
-    TGeoTranslation* trd_honeycomb_trans = new TGeoTranslation("", 0., 0., honeycomb_position);
-    module->AddNode(trdmod1_honeycombvol, 1, trd_honeycomb_trans);
-
-    // Carbon fiber layers
-    TGeoBBox* trd_carbon          = new TGeoBBox("trd_carbon", sizeX / 2., sizeY / 2., carbon_thickness / 2.);
-    TGeoVolume* trdmod1_carbonvol = new TGeoVolume("carbonsheet", trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("module%d_carbonsheet", moduleType), trd_carbon, carbonVolMed);
-    //   TGeoVolume* trdmod1_carbonvol = new TGeoVolume(Form("trd1mod%dcarbon", moduleType), trd_carbon, carbonVolMed);
-    trdmod1_carbonvol->SetLineColor(kGreen);
-    TGeoTranslation* trd_carbon_trans = new TGeoTranslation("", 0., 0., carbon_position);
-    module->AddNode(trdmod1_carbonvol, 1, trd_carbon_trans);
-  }
-
-  if (IncludeAluLedge) {
-    // Al-ledge
-    TGeoBBox* trd_aluledge1 = new TGeoBBox("trd_aluledge1", sizeY / 2., aluminium_width / 2., aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge1vol = new TGeoVolume("aluledge1", trd_aluledge1, aluledgeVolMed);
-    trdmod1_aluledge1vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge1_trans =
-      new TGeoTranslation("", 0., sizeY / 2. - aluminium_width / 2., aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 1, trd_aluledge1_trans);
-    trd_aluledge1_trans = new TGeoTranslation("", 0., -(sizeY / 2. - aluminium_width / 2.), aluminium_position);
-    module->AddNode(trdmod1_aluledge1vol, 2, trd_aluledge1_trans);
-
-
-    // Al-ledge
-    TGeoBBox* trd_aluledge2 =
-      new TGeoBBox("trd_aluledge2", aluminium_width / 2., sizeY / 2. - aluminium_width, aluminium_thickness / 2.);
-    TGeoVolume* trdmod1_aluledge2vol = new TGeoVolume("aluledge2", trd_aluledge2, aluledgeVolMed);
-    trdmod1_aluledge2vol->SetLineColor(kRed);
-
-    // translations
-    TGeoTranslation* trd_aluledge2_trans =
-      new TGeoTranslation("", sizeX / 2. - aluminium_width / 2., 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 1, trd_aluledge2_trans);
-    trd_aluledge2_trans = new TGeoTranslation("", -(sizeX / 2. - aluminium_width / 2.), 0., aluminium_position);
-    module->AddNode(trdmod1_aluledge2vol, 2, trd_aluledge2_trans);
-  }
-
-  // FEBs
-  if (IncludeFebs) {
-    // assemblies
-    TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly("febvol");  // the mother volume of all FEBs
-    TGeoVolumeAssembly* trd_feb_box =
-      new TGeoVolumeAssembly("febbox");  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("module%d_febvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("module%d_febbox", moduleType));  // volume for inclined FEBs, then shifted along y
-    //TGeoVolumeAssembly* trd_feb_vol = new TGeoVolumeAssembly(Form("trd1mod%dfebvol", moduleType));  // the mother volume of all FEBs
-    //TGeoVolumeAssembly* trd_feb_box = new TGeoVolumeAssembly(Form("trd1mod%dfebbox", moduleType));  // volume for inclined FEBs, then shifted along y
-
-    // translations + rotations
-    TGeoTranslation* trd_feb_trans1;      // center to corner
-    TGeoTranslation* trd_feb_trans2;      // corner back
-    TGeoRotation* trd_feb_rotation;       // rotation around x axis
-    TGeoTranslation* trd_feb_y_position;  // shift to y position on TRD
-    //      TGeoTranslation *trd_feb_null;       // no displacement
-
-    // replaced by matrix operation (see below)
-    //  //      Double_t yback, zback;
-    //  //      TGeoCombiTrans  *trd_feb_placement;
-    //  //      // fix Z back offset 0.3 at some point
-    //  //      yback = -    sin(feb_rotation_angle/180*3.141)  * feb_width /2.;
-    //  //      zback = - (1-cos(feb_rotation_angle/180*3.141)) * feb_width /2. + 0.3;
-    //  //      trd_feb_placement = new TGeoCombiTrans(0, feb_pos_y + yback, zback, trd_feb_rotation);
-    //  //      trd_feb_box->AddNode(trdmod1_feb, iFeb+1, trd_feb_placement);
-
-    //      trd_feb_null       = new TGeoTranslation("", 0., 0., 0.);  // empty operation
-    trd_feb_trans1   = new TGeoTranslation("", 0., -feb_thickness / 2.,
-                                         -feb_width / 2.);  // move bottom right corner to center
-    trd_feb_trans2   = new TGeoTranslation("", 0., feb_thickness / 2.,
-                                         feb_width / 2.);  // move bottom right corner back
-    trd_feb_rotation = new TGeoRotation();
-    trd_feb_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-    TGeoHMatrix* incline_feb = new TGeoHMatrix("");
-
-    //        (*incline_feb) = (*trd_feb_null);        // OK
-    //        (*incline_feb) = (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_y_position);  // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_trans2);      // OK
-    //        (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation);    // OK
-    //        (*incline_feb) =  (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2) * (*trd_feb_y_position);  // not OK
-    // trd_feb_y_position is displaced in rotated coordinate system
-
-    // matrix operation to rotate FEB PCB around its corner on the backanel
-    (*incline_feb) = (*trd_feb_trans1) * (*trd_feb_rotation) * (*trd_feb_trans2);  // OK
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    TGeoBBox* trd_feb       = new TGeoBBox("trd_feb", activeAreaX / 2., feb_thickness / 2.,
-                                     feb_width / 2.);               // the FEB itself - as a cuboid
-    TGeoVolume* trdmod1_feb = new TGeoVolume("feb", trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("module%d_feb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    //      TGeoVolume* trdmod1_feb = new TGeoVolume(Form("trd1mod%dfeb", moduleType), trd_feb, febVolMed);  // the FEB made of a certain medium
-    trdmod1_feb->SetLineColor(kYellow);  // set yellow color
-    trd_feb_box->AddNode(trdmod1_feb, 1, incline_feb);
-    // now we have an inclined FEB
-
-    // ASICs
-    if (IncludeAsics) {
-      Double_t asic_pos;
-      Double_t asic_pos_x;
-      TGeoTranslation* trd_asic_trans0;  // ASIC on FEB x position
-      TGeoTranslation* trd_asic_trans1;  // center to corner
-      TGeoTranslation* trd_asic_trans2;  // corner back
-      TGeoRotation* trd_asic_rotation;   // rotation around x axis
-
-      trd_asic_trans1   = new TGeoTranslation("", 0., -(feb_thickness + asic_offset + asic_thickness / 2.),
-                                            -feb_width / 2.);  // move ASIC center to FEB corner
-      trd_asic_trans2   = new TGeoTranslation("", 0., feb_thickness + asic_offset + asic_thickness / 2.,
-                                            feb_width / 2.);  // move FEB corner back to asic center
-      trd_asic_rotation = new TGeoRotation();
-      trd_asic_rotation->RotateX(feb_rotation_angle[moduleType - 1]);
-
-      TGeoHMatrix* incline_asic;
-
-      // put many ASICs on each inclined FEB
-      TGeoBBox* trd_asic = new TGeoBBox("trd_asic", asic_width / 2., asic_thickness / 2.,
-                                        asic_width / 2.);  // ASIC dimensions
-      // TODO: use Silicon as ASICs material
-      TGeoVolume* trdmod1_asic = new TGeoVolume("asic", trd_asic, asicVolMed);  // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("module%d_asic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      //        TGeoVolume* trdmod1_asic = new TGeoVolume(Form("trd1mod%dasic", moduleType), trd_asic, asicVolMed);   // the ASIC made of a certain medium
-      trdmod1_asic->SetLineColor(kBlue);  // set blue color for ASICs
-
-      Int_t nofAsics   = AsicsPerFeb[moduleType - 1] % 100;
-      Int_t groupAsics = AsicsPerFeb[moduleType - 1] / 100;  // either 1 or 2 or 3 (new ultimate)
-
-      if ((nofAsics == 16) && (activeAreaX < 60)) asic_distance = 0.0;  // for 57 cm  // 0.1;  // for 60 cm
-      else
-        asic_distance = 0.4;
-
-      for (Int_t iAsic = 0; iAsic < (nofAsics / groupAsics); iAsic++) {
-        if (groupAsics == 1)  // single ASICs
-        {
-          asic_pos =
-            (iAsic + 0.5) / nofAsics - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 2)  // pairs of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX - (0.5 + asic_distance / 2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 2 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-
-        if (groupAsics == 3)  // triplets of ASICs
-        {
-          asic_pos = (iAsic + 0.5) / (nofAsics / groupAsics)
-                     - 0.5;  // equal spacing of ASICs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-
-          // ASIC 1
-          asic_pos_x      = asic_pos * activeAreaX + 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB);
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 1,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 2
-          asic_pos_x      = asic_pos * activeAreaX;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 2,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-
-          // ASIC 3
-          asic_pos_x      = asic_pos * activeAreaX - 1.1 * asic_width;  // (0.5 + asic_distance/2.) * asic_width;
-          trd_asic_trans0 = new TGeoTranslation("", asic_pos_x, feb_thickness / 2. + asic_thickness / 2. + asic_offset,
-                                                0.);  // move asic on top of FEB
-          incline_asic    = new TGeoHMatrix("");
-          (*incline_asic) = (*trd_asic_trans0) * (*trd_asic_trans1) * (*trd_asic_rotation) * (*trd_asic_trans2);  // OK
-          trd_feb_box->AddNode(trdmod1_asic, 3 * iAsic + 3,
-                               incline_asic);  // now we have ASICs on the inclined FEB
-        }
-      }
-      // now we have an inclined FEB with ASICs
-    }
-
-
-    // now go on with FEB placement
-    Double_t feb_pos;
-    Double_t feb_pos_y;
-
-    Int_t nofFebs = FebsPerModule[moduleType - 1];
-    for (Int_t iFeb = 0; iFeb < nofFebs; iFeb++) {
-      feb_pos = (iFeb + 0.5) / nofFebs - 0.5;  // equal spacing of FEBs on the backpanel
-      // cout << "feb_pos " << iFeb << ": " << feb_pos << endl;
-      feb_pos_y = feb_pos * activeAreaY;
-      feb_pos_y += feb_width / 2. * sin(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.);
-
-      // shift inclined FEB in y to its final position
-      trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y,
-                                               feb_z_offset);  // with additional fixed offset in z direction
-      //        trd_feb_y_position = new TGeoTranslation("", 0., feb_pos_y, 0.0);  // touching the backpanel with the corner
-      trd_feb_vol->AddNode(trd_feb_box, iFeb + 1, trd_feb_y_position);  // position FEB in y
-    }
-
-    if (IncludeRobs) {
-      // GBTx ROBs
-      Double_t rob_size_x    = 20.0;  // 13.0; // 130 mm
-      Double_t rob_size_y    = 9.0;   //  4.5; //  45 mm
-      Double_t rob_offset    = 1.2;
-      Double_t rob_thickness = feb_thickness;
-
-      TGeoVolumeAssembly* trd_rob_box =
-        new TGeoVolumeAssembly("robbox");  // volume for inclined FEBs, then shifted along y
-      TGeoBBox* trd_rob       = new TGeoBBox("trd_rob", rob_size_x / 2., rob_size_y / 2.,
-                                       rob_thickness / 2.);           // the ROB itself
-      TGeoVolume* trdmod1_rob = new TGeoVolume("rob", trd_rob, febVolMed);  // the ROB made of a certain medium
-      trdmod1_rob->SetLineColor(kRed);                                      // set color
-
-      //      TGeoHMatrix *incline_rob = new TGeoHMatrix("");
-      trd_rob_box->AddNode(trdmod1_rob, 1);
-
-      // GBTXs
-      Double_t gbtx_pos;
-      Double_t gbtx_pos_x;
-      Double_t gbtx_pos_y;
-      TGeoTranslation* trd_gbtx_trans1;  // center to corner
-
-      // GBTX parameters
-      const Double_t gbtx_thickness = 0.25;  // 2.5 mm
-      const Double_t gbtx_width     = 3.0;   // 2.0;  1.0;   // 1 cm
-
-      // put many GBTXs on each inclined FEB
-      TGeoBBox* trd_gbtx       = new TGeoBBox("trd_gbtx", gbtx_width / 2., gbtx_width / 2.,
-                                        gbtx_thickness / 2.);             // GBTX dimensions
-      TGeoVolume* trdmod1_gbtx = new TGeoVolume("gbtx", trd_gbtx, asicVolMed);  // the GBTX made of a certain medium
-      trdmod1_gbtx->SetLineColor(kGreen);                                       // set color for GBTXs
-
-      Int_t nofGbtxs   = GbtxPerRob[moduleType - 1] % 100;
-      Int_t groupGbtxs = GbtxPerRob[moduleType - 1] / 100;  // usually 1
-
-      //      nofGbtxs   = 7;
-      //      groupGbtxs = 1;
-
-      Int_t nofGbtxX = (nofGbtxs - 1) / 2. + 1;  // +1 is for GBTx master
-      Int_t nofGbtxY = 2;
-
-      Double_t gbtx_distance = 0.4;
-      Int_t iGbtx            = 1;
-
-      for (Int_t iGbtxX = 0; iGbtxX < nofGbtxX; iGbtxX++) {
-        gbtx_pos = (iGbtxX + 0.5) / nofGbtxX - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-        gbtx_pos_x = -gbtx_pos * rob_size_x;
-
-        if (iGbtxX > 0)
-          for (Int_t iGbtxY = 0; iGbtxY < nofGbtxY; iGbtxY++) {
-            gbtx_pos =
-              (iGbtxY + 0.5) / nofGbtxY - 0.5;  // equal spacing of GBTXs on the FEB, e.g. for no=3 : -1/3, 0, +1/3
-            gbtx_pos_y = gbtx_pos * rob_size_y;
-
-            trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                  rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-            trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                                 trd_gbtx_trans1);  // now we have GBTXs on the ROB
-          }
-        else {
-          gbtx_pos_y = 0;
-
-          trd_gbtx_trans1 = new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y,
-                                                rob_thickness / 2. + gbtx_thickness / 2.);  // move gbtx on top of ROB
-          trd_rob_box->AddNode(trdmod1_gbtx, iGbtx++,
-                               trd_gbtx_trans1);  // now we have GBTXs on the ROB
-        }
-      }
-
-      // now go on with ROB placement
-      Double_t rob_pos;
-      Double_t rob_pos_y;
-      TGeoTranslation* trd_rob_y_position;  // shift to y position on TRD
-
-      Int_t nofRobs = RobsPerModule[moduleType - 1];
-      for (Int_t iRob = 0; iRob < nofRobs; iRob++) {
-        rob_pos   = (iRob + 0.5) / nofRobs - 0.5;  // equal spacing of ROBs on the backpanel
-        rob_pos_y = rob_pos * activeAreaY;
-
-        // shift inclined ROB in y to its final position
-        if (feb_rotation_angle[moduleType - 1] == 90)  // if FEB parallel to backpanel
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y,
-                                                   -feb_width / 2. + rob_offset);  // place ROBs close to FEBs
-        else {
-          //	    Int_t rob_z_pos = 0.;  // test where ROB is placed by default
-          Int_t rob_z_pos =
-            -feb_width / 2. + feb_width * cos(feb_rotation_angle[moduleType - 1] * acos(-1.) / 180.) + rob_offset;
-          if (rob_z_pos > feb_width / 2.)  // if the rob is too far out
-          {
-            rob_z_pos = feb_width / 2. - rob_thickness;  // place ROBs at end of feb volume
-            std::cout << "GBTx ROB was outside of the FEB volume, check "
-                         "overlap with FEB"
-                      << std::endl;
-          }
-          trd_rob_y_position = new TGeoTranslation("", 0., rob_pos_y, rob_z_pos);
-        }
-        trd_feb_vol->AddNode(trd_rob_box, iRob + 1, trd_rob_y_position);  // position FEB in y
-      }
-
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    TGeoTranslation* trd_febvolume_trans = new TGeoTranslation("", 0., 0., febvolume_position);
-    gGeoMan->GetVolume(name)->AddNode(trd_feb_vol, 1,
-                                      trd_febvolume_trans);  // put febvolume at correct z position wrt to the module
-  }
-
-  // DE123
-
-  return module;
-}
-
-//________________________________________________________________________________________________
-//  TRD Bucharest module definition
-TGeoTranslation* tr(NULL);
-TString sexpr;
-void addFlatCableHoles(const Char_t* name)
-{
-  printf("addFlatCableHoles(%s)\n", name);
-  sexpr = name;
-  sexpr += "_bd";
-  for (Int_t c(0); c < 9; c++) {
-    printf("c[%d]\n", c);
-    for (Int_t r(0); r < 10; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, 1.35 + 2.7 * r, 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-    for (Int_t r(10); r < 20; r++) {
-      printf("r[%d]\n", r);
-      tr = new TGeoTranslation(Form("t%s%d%02d", name, c, r), (c - 4) * 6, -1.35 - 2.7 * (r - 10), 0.);
-      tr->RegisterYourself();
-      sexpr += Form("-%s_fc:t%s%d%02d", name, name, c, r);
-    }
-  }
-}
-TGeoVolume* create_trd2d_module_type(Int_t moduleType)
-{
-  Info("create_trd2d_module_type", "Bulding Bucharest Module [%s].", moduleType == 9 ? "TRD2D" : "TRD-2DH");
-  Int_t detTypeIdx     = moduleType == 9 ? 2 : 3;
-  Double_t sizeX       = DetectorSizeX[detTypeIdx];
-  Double_t sizeY       = DetectorSizeY[detTypeIdx];
-  Double_t frameWidth  = FrameWidth[detTypeIdx];
-  Double_t activeAreaX = sizeX - 2 * frameWidth;
-  Double_t activeAreaY = sizeY - 2 * frameWidth;
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* radVolMed       = gGeoMan->GetMedium(RadiatorVolumeMedium);
-  TGeoMedium* latticeVolMed   = gGeoMan->GetMedium(LatticeVolumeMedium);
-  TGeoMedium* kaptonVolMed    = gGeoMan->GetMedium(KaptonVolumeMedium);
-  TGeoMedium* gasVolMed       = gGeoMan->GetMedium(GasVolumeMedium);
-  TGeoMedium* padcopperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);
-  TGeoMedium* padpcbVolMed    = gGeoMan->GetMedium(PadPcbVolumeMedium);
-  TGeoMedium* honeycombVolMed = gGeoMan->GetMedium(HoneycombVolumeMedium);
-  TGeoMedium* carbonVolMed    = gGeoMan->GetMedium(CarbonVolumeMedium);
-  //  TGeoMedium* mylarVolMed       = gGeoMan->GetMedium(MylarVolumeMedium);
-  //  TGeoMedium* electronicsVolMed = gGeoMan->GetMedium(ElectronicsVolumeMedium);
-  TGeoMedium* frameVolMed     = gGeoMan->GetMedium(FrameVolumeMedium);
-  TGeoMedium* febVolMed       = gGeoMan->GetMedium(FebVolumeMedium);
-  TGeoMedium* asicVolMed      = gGeoMan->GetMedium(AsicVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);
-
-  TString name       = Form("module%d", moduleType);
-  TGeoVolume* module = new TGeoVolumeAssembly(name);
-
-
-  if (IncludeRadiator) {  // Radiator
-    TGeoBBox* trd_radiator     = new TGeoBBox("trd_radiator", sizeX / 2., sizeY / 2., radiator_thickness / 2.);
-    TGeoVolume* trdmod1_radvol = new TGeoVolume("Radiator", trd_radiator, radVolMed);
-    trdmod1_radvol->SetLineColor(kRed);
-    trdmod1_radvol->SetTransparency(50);  // (60);  // (70);  // set transparency for the TRD radiator
-    TGeoTranslation* trd_radiator_trans = new TGeoTranslation("", 0., 0., radiator_position);
-    module->AddNode(trdmod1_radvol, 1, trd_radiator_trans);
-  }
-
-  Double_t winIn_C_thickness  = 0.02;
-  Double_t winIn_HC_thickness = 1.;
-  Double_t winIn_thickness    = winIn_HC_thickness + /*2**/ winIn_C_thickness;
-  if (IncludeLattice) {  // Entrance window in the case of the Bucharest prototype
-    Info("create_trd2d_module_type", "make entrance widow ...");
-    // Carbon fiber layers
-    TGeoBBox* winIn_C = new TGeoBBox("winIn_C", 0.3 + activeAreaX / 2., 0.9 + activeAreaY / 2., winIn_C_thickness / 2.);
-    TGeoVolume* vol_winIn_C = new TGeoVolume("vol_winIn_C", winIn_C, carbonVolMed);
-    vol_winIn_C->SetLineColor(kGray);
-    // Honeycomb layer
-    TGeoBBox* winIn_HC =
-      new TGeoBBox("winIn_HC", -0.3 + activeAreaX / 2., 0.3 + activeAreaY / 2., winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_HC = new TGeoVolume("vol_winIn_HC", winIn_HC, honeycombVolMed);
-    vol_winIn_HC->SetLineColor(kOrange);
-    // framex
-    TGeoBBox* winIn_fx =
-      new TGeoBBox("winIn_fx", -0.3 + activeAreaX / 2, WIN_Frame_thickness / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fx = new TGeoVolume("vol_winIn_fx", winIn_fx, frameVolMed);
-    vol_winIn_fx->SetLineColor(kBlue);
-    // framey
-    TGeoBBox* winIn_fy =
-      new TGeoBBox("winIn_fy", WIN_Frame_thickness / 2, (1.8 + activeAreaY) / 2, winIn_HC_thickness / 2.);
-    TGeoVolume* vol_winIn_fy = new TGeoVolume("vol_winIn_fy", winIn_fy, frameVolMed);
-    vol_winIn_fy->SetLineColor(kCyan);
-    // Add up all components
-    TGeoVolumeAssembly* trd_win_in = new TGeoVolumeAssembly("EntranceWin");
-    trd_win_in->AddNode(vol_winIn_fx, 1, new TGeoTranslation("", 0., 0.6 + activeAreaY / 2., 0));
-    trd_win_in->AddNode(vol_winIn_fx, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.6), 0));
-    trd_win_in->AddNode(vol_winIn_fy, 1, new TGeoTranslation("", activeAreaX / 2., 0., 0));
-    trd_win_in->AddNode(vol_winIn_fy, 2, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-
-    trd_win_in->AddNode(vol_winIn_HC, 1);
-    trd_win_in->AddNode(vol_winIn_C, 1,
-                        new TGeoTranslation("", 0., 0., 0.5 * (winIn_HC_thickness + winIn_C_thickness)));
-    //     trd_win_in->AddNode(vol_winIn_C, 2,
-    //                     new TGeoTranslation("", 0., 0., -(winIn_thickness-winIn_C_thickness)/2.));
-    module->AddNode(trd_win_in, 1,
-                    new TGeoTranslation(
-                      "", 0., 0., gasBu_position - gas_thickness / 2. - winIn_C_thickness - winIn_HC_thickness / 2.));
-  }
-
-  // Gas. The volume has to be defined only for pads (read-out) area. Take care in the DigiPara definition
-  TGeoBBox* trd_gas   = new TGeoBBox("trd_gas", 0.5 * activeAreaX, 0.5 * activeAreaY, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas = new TGeoVolume("gas", trd_gas, gasVolMed);
-  vol_gas->SetLineColor(kRed + 3);  //trdmod1_gasvol->SetTransparency(40);
-  TGeoBBox* trd_gas_dstr   = new TGeoBBox("trd_gas_dstr", 0.5 * activeAreaX, 0.2, 0.5 * gas_thickness);
-  TGeoVolume* vol_gas_dstr = new TGeoVolume("inlet", trd_gas_dstr, gasVolMed);
-  vol_gas_dstr->SetLineColor(kRed);
-  module->AddNode(vol_gas, 0, new TGeoTranslation("", 0., 0., gasBu_position));
-  module->AddNode(vol_gas_dstr, 0, new TGeoTranslation("", 0., 0.5 * activeAreaY + 0.2, gasBu_position));
-  module->AddNode(vol_gas_dstr, 1, new TGeoTranslation("", 0., -0.5 * activeAreaY - 0.2, gasBu_position));
-
-  const Double_t pp_pads_thickness = 0.0025;
-  const Double_t pp_pcb_thickness  = 0.0360;
-  const Double_t pp_hc_thickness   = 0.2;
-  const Double_t pp_c_thickness    = 0.05;
-  const Double_t pp_thickness      = pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness + pp_c_thickness;
-  if (IncludePadplane) {
-    const Char_t* ppn = (detTypeIdx == 2 ? "pp" : "pph");
-    Info("create_trd2d_module_type", "make pad-plane ...");
-    // Pad Copper
-    TGeoBBox* trd_pp = new TGeoBBox(Form("%s_cu", ppn), activeAreaX / 2., activeAreaY / 2., pp_pads_thickness / 2.);
-    TGeoVolume* vol_trd_pp = new TGeoVolume(Form("vol_%s_cu", ppn), trd_pp, padcopperVolMed);
-    vol_trd_pp->SetLineColor(kRed);
-    // Pad Plane
-    TGeoBBox* trd_ppPCB =
-      new TGeoBBox(Form("%s_pcb", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_pcb_thickness / 2.);
-    TGeoVolume* vol_trd_ppPCB = new TGeoVolume(Form("vol_%s_pcb", ppn), trd_ppPCB, padpcbVolMed);
-    vol_trd_ppPCB->SetLineColor(kGreen);
-    // Pad Plane HC
-    TGeoBBox* trd_ppHC_bd =
-      new TGeoBBox(Form("%s_hc_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_hc_thickness / 2.);
-    TGeoBBox* trd_ppHC_fc = new TGeoBBox(Form("%s_hc_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_hc", ppn));
-    //TGeoCompositeShape* trd_ppHC = new TGeoCompositeShape(Form("%s_hc", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppHC = new TGeoVolume(Form("vol_%s_hc", ppn), trd_ppHC_bd, honeycombVolMed);
-    vol_trd_ppHC->SetLineColor(kOrange);
-    // Pad Plane C fiber
-    TGeoBBox* trd_ppC_bd =
-      new TGeoBBox(Form("%s_c_bd", ppn), 1.0 + activeAreaX / 2., 0.9 + activeAreaY / 2., pp_c_thickness / 2.);
-    TGeoBBox* trd_ppC_fc = new TGeoBBox(Form("%s_c_fc", ppn), 2.4 / 2., 0.8 / 2., (1.e-4 + pp_c_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles(Form("%s_c", ppn));
-    //TGeoCompositeShape* trd_ppC = new TGeoCompositeShape(Form("%s_c", ppn), sexpr.Data());
-    TGeoVolume* vol_trd_ppC = new TGeoVolume(Form("vol_%s_c", ppn), trd_ppC_bd, carbonVolMed);
-    vol_trd_ppC->SetLineColor(kGray);
-
-    // Add up all components
-    TGeoVolumeAssembly* vol_pp = new TGeoVolumeAssembly("PadPlane");
-    vol_pp->AddNode(vol_trd_pp, 1, new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppPCB, 1,
-                    new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness / 2));
-    vol_pp->AddNode(
-      vol_trd_ppHC, 1,
-      new TGeoTranslation("", 0., 0., -pp_thickness / 2 + pp_pads_thickness + pp_pcb_thickness + pp_hc_thickness / 2));
-    vol_pp->AddNode(vol_trd_ppC, 1, new TGeoTranslation("", 0., 0., pp_thickness / 2 - pp_c_thickness / 2));
-    module->AddNode(vol_pp, 1,
-                    new TGeoTranslation("", 0., 0., gasBu_position + gas_thickness / 2. + pp_thickness / 2.));
-  }
-
-
-  if (IncludeGasFrame) {
-    Info("create_trd2d_module_type", "make gas frame ...");
-    // framex
-    TGeoBBox* frame_fx0       = new TGeoBBox("frame_fx0", activeAreaX / 2., 0.5 / 2., gas_thickness / 2.);
-    TGeoVolume* vol_frame_fx0 = new TGeoVolume("vol_frame_fx0", frame_fx0, frameVolMed);
-    vol_frame_fx0->SetLineColor(kYellow - 2);
-    Double_t frame_fx1_thickness = winIn_thickness + gas_thickness + pp_thickness;
-    TGeoBBox* frame_fx1          = new TGeoBBox("frame_fx1", 1. + activeAreaX / 2., 0.3 / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fx1    = new TGeoVolume("vol_frame_fx1", frame_fx1, frameVolMed);
-    vol_frame_fx1->SetLineColor(kViolet);  //vol_frame_fx1->SetTransparency(50);
-
-    // framey
-    TGeoBBox* frame_fy_0       = new TGeoBBox("frame_fy_0", 0.7 / 2., (1.8 + activeAreaY) / 2., winIn_thickness / 2.);
-    TGeoVolume* vol_frame_fy_0 = new TGeoVolume("vol_frame_fy_0", frame_fy_0, frameVolMed);
-    vol_frame_fy_0->SetLineColor(kBlue);
-    TGeoBBox* frame_fy_1 =
-      new TGeoBBox("frame_fy_1", 1.0 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // catode wire support
-    TGeoVolume* vol_frame_fy_1 = new TGeoVolume("vol_frame_fy_1", frame_fy_1, frameVolMed);
-    vol_frame_fy_1->SetLineColor(kBlue - 3);
-    TGeoBBox* frame_fy_2 =
-      new TGeoBBox("frame_fy_2", 0.7 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // anode wire support
-    TGeoVolume* vol_frame_fy_2 = new TGeoVolume("vol_frame_fy_2", frame_fy_2, frameVolMed);
-    vol_frame_fy_2->SetLineColor(kOrange + 4);
-    TGeoBBox* frame_fy_3 =
-      new TGeoBBox("frame_fy_3", 0.4 / 2., (1.8 + activeAreaY) / 2., 0.4 / 2.);  // pad-plane support
-    TGeoVolume* vol_frame_fy_3 = new TGeoVolume("vol_frame_fy_3", frame_fy_3, frameVolMed);
-    vol_frame_fy_3->SetLineColor(kYellow + 3);
-    // add up framey components
-    TGeoVolumeAssembly* vol_frame_fy0 =
-      new TGeoVolumeAssembly("vol_frame_fy0");  // the mother volume of wire support ledge
-    vol_frame_fy0->AddNode(vol_frame_fy_0, 1,
-                           new TGeoTranslation("", -0.3 - 0.7 / 2., 0., -(0.4 * 1.5 + winIn_thickness / 2.)));
-    vol_frame_fy0->AddNode(vol_frame_fy_1, 1, new TGeoTranslation("", -1.0 / 2., 0., -0.4));
-    vol_frame_fy0->AddNode(vol_frame_fy_2, 1, new TGeoTranslation("", -0.7 / 2., 0., 0.));
-    vol_frame_fy0->AddNode(vol_frame_fy_3, 1, new TGeoTranslation("", -0.4 / 2., 0., 0.4));
-    TGeoBBox* frame_fy1       = new TGeoBBox("frame_fy1", 0.3 / 2., 1.2 + activeAreaY / 2., frame_fx1_thickness / 2.);
-    TGeoVolume* vol_frame_fy1 = new TGeoVolume("vol_frame_fy1", frame_fy1, frameVolMed);
-    vol_frame_fy1->SetLineColor(kViolet + 2);  //vol_frame_fy1->SetTransparency(50);
-
-    // Add up all frames
-    Double_t frame_fx1_position       = -winIn_thickness - gas_thickness / 2. + frame_fx1_thickness / 2.;
-    TGeoVolumeAssembly* trd_gas_frame = new TGeoVolumeAssembly("Frame");  // the mother volume of gas frame
-    trd_gas_frame->AddNode(vol_frame_fx0, 1, new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 / 2, 0));
-    trd_gas_frame->AddNode(vol_frame_fx0, 2, new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 / 2), 0));
-    trd_gas_frame->AddNode(vol_frame_fx1, 1,
-                           new TGeoTranslation("", 0., activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fx1, 2,
-                           new TGeoTranslation("", 0., -(activeAreaY / 2. + 0.4 + 0.5 + 0.3 / 2), frame_fx1_position));
-
-    trd_gas_frame->AddNode(vol_frame_fy0, 1, new TGeoTranslation("", -activeAreaX / 2., 0., 0));
-    TGeoRotation* fy_rot = new TGeoRotation();
-    fy_rot->RotateZ(180.);
-    TGeoTranslation* fy_tra   = new TGeoTranslation("", -activeAreaX / 2., 0., 0);
-    TGeoHMatrix* fy_transform = new TGeoHMatrix("");
-    (*fy_transform)           = (*fy_rot) * (*fy_tra);
-    trd_gas_frame->AddNode(vol_frame_fy0, 2, fy_transform);
-    trd_gas_frame->AddNode(vol_frame_fy1, 1,
-                           new TGeoTranslation("", activeAreaX / 2. + 1.0 + 0.3 / 2, 0, frame_fx1_position));
-    trd_gas_frame->AddNode(vol_frame_fy1, 2,
-                           new TGeoTranslation("", -(activeAreaX / 2. + 1.0 + 0.3 / 2), 0, frame_fx1_position));
-
-    // add Al reinforcements on the edges of the gas frame
-    if (moduleType == 9) {
-      // y direction
-      TGeoBBox* frame_al_y0       = new TGeoBBox("frame_al_y0", 0.4 / 2., (sizeY - 1.4) / 2., 1.8 / 2.);
-      TGeoVolume* vol_frame_al_y0 = new TGeoVolume("vol_frame_al_y0", frame_al_y0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y0, 1, new TGeoTranslation("", -0.5 * sizeX + 1, 0, -1.));
-      trd_gas_frame->AddNode(vol_frame_al_y0, 2, new TGeoTranslation("", +0.5 * sizeX - 1, 0, -1.));
-      //
-      TGeoBBox* frame_al_y1       = new TGeoBBox("frame_al_y1", 2.5 / 2., (sizeY - 1.4) / 2., 0.4 / 2.);
-      TGeoVolume* vol_frame_al_y1 = new TGeoVolume("vol_frame_al_y1", frame_al_y1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y1, 1, new TGeoTranslation("", -0.5 * sizeX + 1 - 2.5 + 1.05, 0, -0.3));
-      trd_gas_frame->AddNode(vol_frame_al_y1, 2, new TGeoTranslation("", +0.5 * sizeX - 1 + 2.5 - 1.05, 0, -0.3));
-      // connector to frame
-      TGeoBBox* frame_al_y2       = new TGeoBBox("frame_al_y2", 2.5 / 2., (sizeY + 5) / 2., 0.8 / 2.);
-      TGeoVolume* vol_frame_al_y2 = new TGeoVolume("vol_frame_al_y2", frame_al_y2, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_y2, 1, new TGeoTranslation("", -0.5 * sizeX - 0.45, 0, -0.9));
-      trd_gas_frame->AddNode(vol_frame_al_y2, 2, new TGeoTranslation("", +0.5 * sizeX + 0.45, 0, -0.9));
-
-      // x direction
-      sizeY                       = 58.2;  // dirty fix for the TRD-2D @ mCBM 21
-      TGeoBBox* frame_al_x0       = new TGeoBBox("frame_al_x0", (sizeX - 2.4) / 2., 0.4 / 2, 2.5 / 2.);
-      TGeoVolume* vol_frame_al_x0 = new TGeoVolume("vol_frame_al_x0", frame_al_x0, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x0, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 0.4), 0));
-      trd_gas_frame->AddNode(vol_frame_al_x0, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 0.4), 0));
-      // ====
-      TGeoBBox* frame_al_x1       = new TGeoBBox("frame_al_x1", (sizeX - 2.4) / 2., 2.5 / 2., 0.4 / 2);
-      TGeoVolume* vol_frame_al_x1 = new TGeoVolume("vol_frame_al_x1", frame_al_x1, aluminiumVolMed);
-      trd_gas_frame->AddNode(vol_frame_al_x1, 1, new TGeoTranslation("", 0, -0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-      trd_gas_frame->AddNode(vol_frame_al_x1, 2, new TGeoTranslation("", 0, +0.5 * (sizeY + 2.5), -0.5 * (2.5 + 0.4)));
-    }
-
-    module->AddNode(trd_gas_frame, 1, new TGeoTranslation("", 0., 0., gasBu_position));
-  }
-
-
-  const Double_t bp_hc_thickness  = 2.;
-  const Double_t bp_pcb_thickness = 0.05;
-  const Double_t bp_cu_thickness  = 0.003;
-  const Double_t bp_thickness     = bp_cu_thickness + bp_hc_thickness + bp_pcb_thickness;
-  const Double_t bp_position      = gasBu_position + 0.5 * gas_thickness + pp_thickness;
-  if (IncludeBackpanel) {
-    Info("create_trd2d_module_type", "make backpanel ...");
-    // Honeycomb board and flat-cable hole
-    TGeoBBox* bp_hc_bd = new TGeoBBox("bp_hc_bd", activeAreaX / 2., activeAreaY / 2., bp_hc_thickness / 2.);
-    TGeoBBox* bp_hc_fc = new TGeoBBox("bp_hc_fc", 2.4 / 2., 0.8 / 2., (1.e-4 + bp_hc_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_hc");
-    //TGeoCompositeShape* bp_hc = new TGeoCompositeShape("bp_hc", sexpr.Data());
-    TGeoVolume* vol_bp_hc = new TGeoVolume(".vol_bp_hc", bp_hc_bd, honeycombVolMed);
-    vol_bp_hc->SetLineColor(kOrange);
-    // Screen fibre-glass support (PCB)
-    TGeoBBox* bp_pcb_bd =
-      new TGeoBBox("bp_pcb_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_pcb_thickness / 2.);
-    TGeoBBox* bp_pcb_fc = new TGeoBBox("bp_pcb_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_pcb_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_pcb");
-    //TGeoCompositeShape* bp_pcb = new TGeoCompositeShape("bp_pcb", sexpr.Data());
-    TGeoVolume* vol_bp_pcb = new TGeoVolume("vol_bp_pcb", bp_pcb_bd, padpcbVolMed);
-    vol_bp_pcb->SetLineColor(kGreen);
-    // Pad Copper
-    TGeoBBox* bp_cu_bd = new TGeoBBox("bp_cu_bd", 0.5 + activeAreaX / 2., 0.5 + activeAreaY / 2., bp_cu_thickness / 2.);
-    TGeoBBox* bp_cu_fc = new TGeoBBox("bp_cu_fc", 2.4 / 2., 0.8 / 2., (1.e-3 + bp_cu_thickness) / 2.);
-    //if(detTypeIdx==2) addFlatCableHoles("bp_cu");
-    //TGeoCompositeShape* bp_cu = new TGeoCompositeShape("bp_cu", sexpr.Data());
-    TGeoVolume* vol_bp_cu = new TGeoVolume("vol_bp_cu", bp_cu_bd, padcopperVolMed);
-    vol_bp_cu->SetLineColor(kRed);
-
-    TGeoBBox* bp_fx       = new TGeoBBox("bp_fx", activeAreaX / 2., 0.5 / 2., bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fx = new TGeoVolume("vol_bp_fx", bp_fx, frameVolMed);
-    vol_bp_fx->SetLineColor(kViolet);  //vol_gas_fx1->SetTransparency(50);
-    TGeoBBox* bp_fy       = new TGeoBBox("bp_fy", 0.5 / 2, 0.5 + 0.5 * activeAreaY, bp_hc_thickness / 2.);
-    TGeoVolume* vol_bp_fy = new TGeoVolume("vol_bp_fy", bp_fy, frameVolMed);
-    vol_bp_fy->SetLineColor(kViolet + 2);
-
-    // Add up all components
-    TGeoVolumeAssembly* trd_supp = new TGeoVolumeAssembly("BackPanel");
-    trd_supp->AddNode(vol_bp_hc, 1);
-    trd_supp->AddNode(vol_bp_pcb, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + bp_pcb_thickness)));
-    trd_supp->AddNode(
-      vol_bp_cu, 1, new TGeoTranslation("", 0., 0., 0.5 * (bp_hc_thickness + 2 * bp_pcb_thickness + bp_cu_thickness)));
-    trd_supp->AddNode(vol_bp_fx, 1, new TGeoTranslation("", 0., 0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fx, 2, new TGeoTranslation("", 0., -0.5 * (0.5 + activeAreaY), 0));
-    trd_supp->AddNode(vol_bp_fy, 1, new TGeoTranslation("", 0.5 * (0.5 + activeAreaX), 0., 0.));
-    trd_supp->AddNode(vol_bp_fy, 2, new TGeoTranslation("", -0.5 * (0.5 + activeAreaX), 0., 0.));
-    module->AddNode(
-      trd_supp, 1,
-      new TGeoTranslation("", 0., 0., gasBu_position + 0.5 * gas_thickness + pp_thickness + 0.5 * bp_hc_thickness));
-  }
-
-  // FEBs
-  // ROB FASP
-  const Double_t FASPRO_zspace    = 1.5;   // gap size between boards
-  const Double_t FASPRO_length    = 17.9;  // length of FASP FEBs in cm
-  const Double_t FASPRO_width     = 5.12;  // width of FASP FEBs in cm
-  const Double_t FASPRO_dx        = 0.01;  //
-  const Double_t FASPRO_dy        = 0.28;  //
-  const Double_t FASPRO_thickness = 0.17;
-  const Double_t FASPRO_position  = bp_position + bp_thickness + FASPRO_zspace;
-  const Double_t GETS_length      = 13.9;  // length of PolarFire FEBs in cm
-  const Double_t GETS_width       = 5.12;  // width of PolarFire FEBs in cm
-  const Double_t GETS_thickness   = 0.2;
-  const Double_t GA01_length      = 5.;   // length of LV FEBs in cm
-  const Double_t GA01_width       = 5.1;  // width of LV FEBs in cm
-  const Double_t GA01_thickness   = 0.2;
-
-  // ASIC parameters
-  const Double_t fasp_size[]     = {1.2, 1.2, 0.2};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t faspConn_size[] = {2.1, 0.3, 0.6};  // FASP package and interposer size 1.5x1.5 cm2
-  const Double_t fasp_xoffset    = 6.0;              // ASIC offset from ROC middle (horizontally)
-  const Double_t fasp_yoffset    = 1.35;             // ASIC offset from DET connector (vertical)
-  const Double_t fpga_size[]     = {1.2, 1.2, 0.2};  // PolarFire FPGA package size 1.5x1.5 cm2
-  // FMC+ connector definition
-  const Double_t FMCwidth  = 2.0;   // width of a MF FMC connector
-  const Double_t FMClength = 5.6;   // length of a MF FMC connector
-  const Double_t FMCheight = 1.13;  // height of a MF FMC connector
-  const Double_t FMCsuppD  = 0.8;   // outer radius of FMC connector side supports
-  const Double_t FMCsuppX  = 0.6;   // FMC connector side supports
-  // GETS2C-ROB3 connector boord parameters
-  const Double_t robConn_size_x = 3.9;  //15.0;
-  const Double_t robConn_size_y = 15.0;
-  //  const Double_t robConn_xoffset      =  6.0;
-  // SATA+ connector definition
-  const Double_t SATAwidth  = 0.7;  // width of a SATA connector on GA01
-  const Double_t SATAlength = 1.7;  // length of a SATA connector on GA01
-  const Double_t SATAheight = 0.8;  // height of a SATA connector on GA01
-  // GA01 connector definition
-  const Double_t BGAwidth  = 0.4;  // width of a GETS to GA01 connector
-  const Double_t BGAlength = 4.5;  // length of a GETS to GA01 connector
-  const Double_t BGAheight = 0.8;  // height of a GETS to GA01 connector
-  if (IncludeFebs) {
-    Info("create_trd2d_module_type", "make FEBs ...");
-
-    // Create all FEBs and place them in an assembly which will be added to the TRD module
-    // FASPRO board
-    TGeoBBox* faspro_bd       = new TGeoBBox("faspro_bd", FASPRO_length / 2., FASPRO_width / 2., FASPRO_thickness / 2.);
-    TGeoVolume* vol_faspro_bd = new TGeoVolume("vol_faspro_bd", faspro_bd, febVolMed);
-    vol_faspro_bd->SetLineColor(kGreen + 3);  //vol_faspro_bd->SetTransparency(50);
-    // GETS board
-    TGeoBBox* gets_bd       = new TGeoBBox("gets_bd", GETS_length / 2., GETS_width / 2., GETS_thickness / 2.);
-    TGeoVolume* vol_gets_bd = new TGeoVolume("vol_gets_bd", gets_bd, febVolMed);
-    vol_gets_bd->SetLineColor(kGreen + 3);  //vol_gets_bd->SetTransparency(50);
-    // GA01 board
-    TGeoBBox* ga01_bd       = new TGeoBBox("ga01_bd", GA01_length / 2., GA01_width / 2., GA01_thickness / 2.);
-    TGeoVolume* vol_ga01_bd = new TGeoVolume("vol_ga01_bd", ga01_bd, febVolMed);
-    vol_ga01_bd->SetLineColor(kGreen + 7);  //vol_gets_bd->SetTransparency(50);
-
-    // Create connectors
-    // FMC connector
-    TGeoBBox* fmc_conn       = new TGeoBBox("fmc_conn", 0.5 * FMClength, 0.5 * FMCwidth, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_conn = new TGeoVolume("vol_fmc_conn", fmc_conn, febVolMed);
-    vol_fmc_conn->SetLineColor(kGray + 2);
-    TGeoTube* fmc_connSupp       = new TGeoTube("fmc_connSupp", 0, 0.5 * FMCsuppD, 0.5 * FMCheight);
-    TGeoVolume* vol_fmc_connSupp = new TGeoVolume("vol_fmc_connSupp", fmc_connSupp, aluminiumVolMed);  // support Al
-    vol_fmc_connSupp->SetLineColor(kGray);
-    TGeoVolumeAssembly* fmc_connect = new TGeoVolumeAssembly("FMC");
-    fmc_connect->AddNode(vol_fmc_conn, 1);
-    fmc_connect->AddNode(vol_fmc_connSupp, 1, new TGeoTranslation("", 0.5 * FMClength + FMCsuppX, 0, 0.));
-    fmc_connect->AddNode(vol_fmc_connSupp, 2, new TGeoTranslation("", -(0.5 * FMClength + FMCsuppX), 0, 0.));
-    // SATA connectors
-    TGeoBBox* sata_conn       = new TGeoBBox("sata_conn", 0.5 * SATAwidth, 0.5 * SATAlength, 0.5 * SATAheight);
-    TGeoVolume* vol_sata_conn = new TGeoVolume("vol_sata_conn", sata_conn, febVolMed);
-    vol_sata_conn->SetLineColor(kGray + 2);
-    // BGA connectors
-    TGeoBBox* bga_conn       = new TGeoBBox("bga_conn", 0.5 * BGAwidth, 0.5 * BGAlength, 0.5 * BGAheight);
-    TGeoVolume* vol_bga_conn = new TGeoVolume("vol_bga_conn", bga_conn, febVolMed);
-    vol_bga_conn->SetLineColor(kGray + 2);
-
-    // Create GA01 board
-    TGeoVolumeAssembly* ga01 = new TGeoVolumeAssembly("GA01");
-    ga01->AddNode(vol_ga01_bd, 1);
-    Float_t sataConnPosX[] = {2, 1.2, -1.}, sataConnPosY[] = {0, 1.5, 1};
-    for (Int_t ic(-2); ic <= 2; ic++) {
-      ga01->AddNode(vol_sata_conn, ic + 2,
-                    new TGeoTranslation("", sataConnPosX[abs(ic)], (ic > 0 ? 1 : -1) * sataConnPosY[abs(ic)],
-                                        0.5 * (GA01_thickness + SATAheight)));
-    }
-    ga01->AddNode(vol_bga_conn, 1,
-                  new TGeoTranslation("", -0.5 * GA01_length + 0.5, 0, -0.5 * (GA01_thickness + BGAheight)));
-
-    // Add up all elements of FASPRO
-    TGeoVolumeAssembly* faspro = new TGeoVolumeAssembly("FASPRO");
-    faspro->AddNode(vol_faspro_bd, 1);
-    faspro->AddNode(fmc_connect, 0, new TGeoTranslation("", 0, 0, 0.5 * FMCheight + 0.5 * FASPRO_thickness));
-    Double_t GETS_zpos = 0.5 * FASPRO_thickness + FMCheight + 0.5 * GETS_thickness;
-    faspro->AddNode(vol_gets_bd, 1, new TGeoTranslation("", 0, 0, GETS_zpos));
-    Double_t GA01_zpos = GETS_zpos + 0.5 * GETS_thickness + BGAheight + 0.5 * GA01_thickness;
-    faspro->AddNode(ga01, 1, new TGeoTranslation("", 0.5 * GETS_length + 0.5 * GA01_length - 1., 0, GA01_zpos));
-
-    // ASICs
-    if (IncludeAsics) {
-      Info("create_trd2d_module_type", "make ASICs ...");
-      TGeoBBox* fasp_asic       = new TGeoBBox("fasp_asic", 0.5 * fasp_size[0], 0.5 * fasp_size[1], 0.5 * fasp_size[2]);
-      TGeoVolume* vol_fasp_asic = new TGeoVolume("FASP", fasp_asic, padpcbVolMed);
-      vol_fasp_asic->SetLineColor(kBlack);
-      TGeoBBox* fasp_conn =
-        new TGeoBBox("fasp_conn", 0.5 * faspConn_size[0], 0.5 * faspConn_size[1], 0.5 * faspConn_size[2]);
-      TGeoVolume* vol_fasp_conn = new TGeoVolume("fasp_conn", fasp_conn, padpcbVolMed);
-      vol_fasp_conn->SetLineColor(kRed + 4);
-      for (Int_t cAsic(-1), iAsic(0); cAsic <= 1; cAsic++) {
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, 0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1],
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-        faspro->AddNode(vol_fasp_asic, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset, -fasp_yoffset,
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * fasp_size[2])));
-        faspro->AddNode(vol_fasp_conn, iAsic,
-                        new TGeoTranslation("", cAsic * fasp_xoffset,
-                                            -(0.5 * FASPRO_width - 0.2 - 0.5 * faspConn_size[1]),
-                                            -1 * (0.5 * FASPRO_thickness + 0.5 * faspConn_size[2])));
-        iAsic++;
-      }
-
-      TGeoBBox* fpga_asic       = new TGeoBBox("fpga_asic", 0.5 * fpga_size[0], 0.5 * fpga_size[1], 0.5 * fpga_size[2]);
-      TGeoVolume* vol_fpga_asic = new TGeoVolume("FPGA", fpga_asic, asicVolMed);
-      vol_fpga_asic->SetLineColor(kBlack);
-      faspro->AddNode(vol_fpga_asic, 0,
-                      new TGeoTranslation("", 0, -fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-      faspro->AddNode(vol_fpga_asic, 1,
-                      new TGeoTranslation("", 0, fasp_yoffset, GETS_zpos + 0.5 * GETS_thickness + 0.5 * fpga_size[2]));
-    }
-    // supports for electronics
-    TGeoBBox* faspro_fy = new TGeoBBox("faspro_fy", 0.4 / 2, 0.5 + 0.5 * activeAreaY, 0.5 * (FASPRO_zspace - 0.2));
-    TGeoVolume* vol_faspro_fy = new TGeoVolume("faspro_fy", faspro_fy, frameVolMed);
-    vol_faspro_fy->SetLineColor(kViolet + 2);  //vol_faspro_fy->SetTransparency(50);
-
-    // now go on with FEB placement
-    TGeoVolumeAssembly* vol_feb = new TGeoVolumeAssembly("FEB");  // the mother volume of all FEBs
-    if (moduleType == 9) {                                        // define ROB placement fot large 2D chamber
-      Int_t cFeb(1);
-      for (Int_t iFeb(0); cFeb < 2; cFeb++) {
-        vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                         new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3, 0.,
-                                             -0.5 * (FASPRO_thickness + FASPRO_zspace) + 0.05));
-        for (Int_t rFeb(1); rFeb < 5; rFeb++) {
-          // the upper side ...
-          //         vol_feb->AddNode(faspro, iFeb++,
-          //                           new TGeoTranslation("", cFeb*(FASPRO_length+FASPRO_dx), (rFeb+0.5)*(FASPRO_width+FASPRO_dy), 0));
-          // the bottom side ...
-          vol_feb->AddNode(faspro, iFeb++,
-                           new TGeoTranslation("", cFeb * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3.,
-                                               -(rFeb + 0.5) * (FASPRO_width + FASPRO_dy) + FASPRO_width / 2, 0));
-        }
-      }
-      vol_feb->AddNode(vol_faspro_fy, cFeb + 1,
-                       new TGeoTranslation("", (cFeb - 0.5) * (FASPRO_length + FASPRO_dx) - FASPRO_length / 3., 0.,
-                                           -0.5 * (FASPRO_thickness + FASPRO_zspace)));
-    }
-    else {  // define ROB placement fot small 2D hybrid chamber
-      TGeoRotation* faspro_rot = new TGeoRotation("faspro_rot");
-      faspro_rot->RotateX(180.);
-      faspro_rot->RegisterYourself();
-      TGeoTranslation* faspro_pos = new TGeoTranslation("", -4, 1.5 * FASPRO_width + 0.5, -FASPRO_zspace);
-      TGeoHMatrix* faspro_mx      = new TGeoHMatrix("");
-      (*faspro_mx)                = (*faspro_pos) * (*faspro_rot);
-      vol_feb->AddNode(faspro, 5, faspro_mx);
-    }
-
-    if (IncludeRobs) {
-      Info("create_trd2d_module_type", "make ROBs ...");
-      TGeoVolumeAssembly* crob = new TGeoVolumeAssembly("C-ROB");
-      TGeoBBox* crob_bd        = new TGeoBBox("crob_bd", rob_size_x / 2., rob_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_bd  = new TGeoVolume("crob_bd", crob_bd, febVolMed);  // the ROB made of PCB
-      vol_crob_bd->SetLineColor(kRed + 8);                                       // set color
-      TGeoRotation* crob_fmc_rot = new TGeoRotation("crob_fmc_rot");
-      crob_fmc_rot->RotateZ(90.);
-      crob_fmc_rot->RegisterYourself();
-      TGeoTranslation* crob_fmc_tra = new TGeoTranslation("crob_fmc_tra", 0., 0.5 * (FMCwidth - robConn_size_x) + 0.2,
-                                                          0.5 * (FMCheight + rob_thickness));
-      crob_fmc_tra->RegisterYourself();
-      TGeoHMatrix* crob_fmc_transform = new TGeoHMatrix("");
-      (*crob_fmc_transform)           = (*crob_fmc_rot) * (*crob_fmc_tra);
-      // Add GETS - CROB interface
-      TGeoBBox* crob_addapt = new TGeoBBox("crob_addapt", robConn_size_x / 2., robConn_size_y / 2., rob_thickness / 2.);
-      TGeoVolume* vol_crob_addapt = new TGeoVolume("crob_addapt", crob_addapt, febVolMed);  // the ROB made of PCB
-      vol_crob_addapt->SetLineColor(kRed + 6);                                              // set color
-      crob->AddNode(vol_crob_addapt, 0);
-      crob->AddNode(fmc_connect, 1, crob_fmc_transform);
-      crob->AddNode(vol_crob_bd, 1,
-                    new TGeoTranslation("", -0.5 * (rob_size_x - robConn_size_x) + 1.5, 0., FMCheight + rob_thickness));
-
-      // GBTXs
-      TGeoBBox* crob_gbtx       = new TGeoBBox("crob_gbtx", gbtx_width / 2., gbtx_width / 2., gbtx_thickness / 2.);
-      TGeoVolume* vol_crob_gbtx = new TGeoVolume("crob_gbtx", crob_gbtx, asicVolMed);
-      vol_crob_gbtx->SetLineColor(kGreen);
-      //place 3 GBTXs on each C-ROC
-      Double_t gbtx_pos_x = 0.5 * (-rob_size_x + gbtx_width) - 1.5 /*-0.5*/;
-      Double_t gbtx_pos_y = 0.5 * (rob_size_y - gbtx_width) - 0.5;
-      crob->AddNode(vol_crob_gbtx, 0,
-                    new TGeoTranslation("", gbtx_pos_x, gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 1,
-                    new TGeoTranslation("", gbtx_pos_x, -gbtx_pos_y, FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      crob->AddNode(vol_crob_gbtx, 2,
-                    new TGeoTranslation("", gbtx_pos_x + 5., 0., FMCheight + rob_thickness + 0.5 * gbtx_thickness));
-      //       Info("create_trd2d_module_type", "place ROBs ...");
-      //       // now go on with ROB placement
-      //       Int_t nofRobs = RobsPerModule[ 2 ], nofRobsHalf(nofRobs/2);
-      //       for (Int_t iRob = 0, jRob(0); iRob < nofRobsHalf; iRob++) {
-      //         printf("ROB[%d]\n", iRob);
-      //         Double_t rob_pos   = (iRob + 0.5) / nofRobsHalf - 0.5,   // equal spacing of ROBs on the backpanel
-      //                  rob_pos_y = rob_pos * activeAreaY;
-      //         vol_feb->AddNode(crob, jRob++, new TGeoTranslation("",  -0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos));
-      //         TGeoRotation *crob_rot = new TGeoRotation("crob_rot"); crob_rot->RotateZ(180.); crob_rot->RegisterYourself();
-      //         TGeoTranslation *crob_tra = new TGeoTranslation("crob_tra",  0.5*(FASPRO_length+FASPRO_dx), rob_pos_y, LVB_pos); crob_tra->RegisterYourself();
-      //         TGeoHMatrix *crob_transform = new TGeoHMatrix(""); (*crob_transform)=(*crob_tra)*(*crob_rot);
-      //         vol_feb->AddNode(crob, jRob++, crob_transform);
-      //       }
-    }  // IncludeGbtx
-
-    // put FEB box on module
-    module->AddNode(
-      vol_feb, 1,
-      new TGeoTranslation("", 0., 0., FASPRO_position));  // put febvolume at correct z position wrt to the module
-  }
-
-  return module;
-}
-
-
-Int_t copy_nr(Int_t stationNr, Int_t copyNr, Int_t isRotated, Int_t planeNr, Int_t modinplaneNr)
-{
-  if (modinplaneNr > 128)
-    printf("Warning: too many modules in this layer %02d (max 128 according to "
-           "CbmTrdAddress)\n",
-           planeNr);
-
-  return (stationNr * 100000000  // 1 digit
-          + copyNr * 1000000     // 2 digit
-          + isRotated * 100000   // 1 digit
-          + planeNr * 1000       // 2 digit
-          + modinplaneNr * 1);   // 3 digit
-}
-
-void create_detector_layers(Int_t layerId)
-{
-  Int_t module_id = 0;
-  Int_t layerType = LayerType[layerId] / 10;  // this is also a station number
-  Int_t isRotated = LayerType[layerId] % 10;  // is 1 for layers 2,4, ...
-
-  TGeoRotation* module_rotation = new TGeoRotation();
-
-  Int_t stationNr = layerType;
-
-  // rotation is now done in the for loop for each module individually
-  //  if ( isRotated == 1 ) {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ(90.);
-  //  } else {
-  //    module_rotation = new TGeoRotation();
-  //    module_rotation->RotateZ( 0.);
-  //  }
-
-  Int_t innerarray_size1 = LayerArraySize[layerType - 1][0];
-  Int_t innerarray_size2 = LayerArraySize[layerType - 1][1];
-  const Int_t* innerLayer;
-
-  Int_t outerarray_size1 = LayerArraySize[layerType - 1][2];
-  Int_t outerarray_size2 = LayerArraySize[layerType - 1][3];
-  const Int_t* outerLayer;
-
-  if (1 == layerType) {
-    innerLayer = (Int_t*) layer1i;
-    outerLayer = (Int_t*) layer1o;
-  }
-  else if (2 == layerType) {
-    innerLayer = (Int_t*) layer2i;
-    outerLayer = (Int_t*) layer2o;
-  }
-  else if (3 == layerType) {
-    innerLayer = (Int_t*) layer3i;
-    outerLayer = (Int_t*) layer3o;
-  }
-  else {
-    std::cout << "Type of layer not known" << std::endl;
-  }
-  Info("create_detector_layers", "Layer id(%d) type(%d)", layerId, layerType);
-
-  // add layer keeping volume
-  TString layername = Form("layer%02d", PlaneId[layerId]);
-  TGeoVolume* layer = new TGeoVolumeAssembly(layername);
-
-  // compute layer copy number
-  Int_t i = LayerType[layerId] / 10 * 10000    // 1 digit  // fStation
-            + LayerType[layerId] % 10 * 1000   // 1 digit  // isRotated
-            + LayerNrInStation[layerId] * 100  // 1 digit  // fLayer
-            + PlaneId[layerId];  // 2 digits // fPlane   // layer type as leading digit in copy number of layer
-  gGeoMan->GetVolume(geoVersion)->AddNode(layer, i);
-
-  //  Int_t i = 100 + PlaneId[layerId];
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(layer, 1);
-  //  cout << layername << endl;
-
-  Double_t ExplodeScale = 1.00;
-  if (DoExplode)  // if explosion, set scale
-    ExplodeScale = ExplodeFactor;
-
-  Int_t modId = 0;  // module id, only within this layer
-
-  Int_t copyNrIn[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 1; type <= 4; type++) {
-    for (Int_t j = (innerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < innerarray_size2; i++) {
-        module_id = *(innerLayer + (j * innerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 2);
-          Int_t x = i - 2;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[0] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[0] * y * ExplodeScale + dy;
-          copyNrIn[type - 1]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrIn[type - 1], PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrIn[type - 1], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrIn[type - 1], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-          //          gGeoMan->GetVolume(geoVersion)->AddNode(gModules[type - 1], copy, module_placement);
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  Int_t copyNrOut[4] = {0, 0, 0, 0};  // copy number for each module type
-  for (Int_t type = 5; type <= 8; type++) {
-    for (Int_t j = (outerarray_size1 - 1); j >= 0; j--) {  // start from the bottom
-      for (Int_t i = 0; i < outerarray_size2; i++) {
-        module_id = *(outerLayer + (j * outerarray_size2 + i));
-        if (module_id / 100 == type) {
-          Info("create_detector_layers", "add module[%d] of type[%d]", module_id, type);
-          Int_t y = -(j - 4);
-          Int_t x = i - 5;
-
-          // displacement
-          Double_t dx = 0;
-          Double_t dy = 0;
-          Double_t dz = 0;
-
-          if (DisplaceRandom) {
-            dx = (r3.Rndm() - .5) * 2 * maxdx;  // max +- 0.1 cm shift
-            dy = (r3.Rndm() - .5) * 2 * maxdy;  // max +- 0.1 cm shift
-            dz = (r3.Rndm() - .5) * 2 * maxdz;  // max +- 1.0 cm shift
-          }
-
-          Double_t xPos = DetectorSizeX[1] * x * ExplodeScale + dx;
-          Double_t yPos = DetectorSizeY[1] * y * ExplodeScale + dy;
-          copyNrOut[type - 5]++;
-          modId++;
-
-          // statistics per layer and module type
-          ModuleStats[layerId][type - 1]++;
-
-          //          Int_t copy = copy_nr_modid(stationNr, layerNrInStation, copyNrOut[type - 5],  PlaneId[layerId], modId);  // with modID
-          //          Int_t copy = copy_nr(stationNr, copyNrOut[type - 5], isRotated, PlaneId[layerId], modId);
-
-          // take care of FEB orientation - away from beam
-          Int_t copy      = 0;
-          module_rotation = new TGeoRotation();  // need to renew rotation to start from 0 degree angle
-          if (isRotated == 0)                    // layer 1,3 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id / 10 % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id / 10 % 10) * 90.);  // rotate module by   0 or 180 degrees, see layer[1-3][i,o] - vertical pads
-          }
-          else  // layer 2,4 ...
-          {
-            copy = copy_nr(stationNr, copyNrOut[type - 5], module_id % 10, PlaneId[layerId], modId);
-            module_rotation->RotateZ(
-              (module_id % 10) * 90.);  // rotate module by  90 or 270 degrees, see layer[1-3][i,o] - horizontal pads
-          }
-
-          // rotation
-          Double_t drotx = 0;
-          Double_t droty = 0;
-          Double_t drotz = 0;
-
-          if (RotateRandom) {
-            drotx = (r3.Rndm() - .5) * 2 * maxdrotx;
-            droty = (r3.Rndm() - .5) * 2 * maxdroty;
-            drotz = (r3.Rndm() - .5) * 2 * maxdrotz;
-
-            module_rotation->RotateZ(drotz);
-            module_rotation->RotateY(droty);
-            module_rotation->RotateX(drotx);
-          }
-
-          Double_t frameref_angle = 0;
-          Double_t layer_angle    = 0;
-
-          cout << "layer " << layerId << " ---" << endl;
-          frameref_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + 3 * LayerThickness));
-          //          frameref_angle = 15. / 180. * acos(-1);  // set a fixed reference angle
-          cout << "reference angle " << frameref_angle * 180 / acos(-1) << endl;
-
-          layer_angle = atan((DetectorSizeX[1] / 2. - FrameWidth[1]) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "layer     angle " << layer_angle * 180 / acos(-1) << endl;
-          // DEDE
-          // xPos = tan( frameref_angle ) * (zfront[setupid] + layerId * LayerThickness) - (DetectorSizeX[1]/2. - FrameWidth[1]);  // shift module along x-axis
-          xPos = 0;
-          if (layerId == 2) {
-            xPos += -22;  // offset in x of 1st large TRD in mCBM 2021_07
-            yPos += -0.5;
-          }  // offset in x of 1st large TRD in mCBM 2021_07
-          if (layerId == 3) {
-            xPos += -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-            yPos += 4.5;
-          }  // offset in x of 2nd large TRD in mCBM 2021_07
-
-          layer_angle =
-            atan((DetectorSizeX[1] / 2. - FrameWidth[1] + xPos) / (zfront[setupid] + layerId * LayerThickness));
-          cout << "corrected angle " << layer_angle * 180 / acos(-1) << endl;
-
-
-          //          Double_t frameangle[4] = {0};
-          //          for ( Int_t ilayer = 3; ilayer >= 0; ilayer--)
-          //          {
-          //            frameangle[ilayer] = atan( (DetectorSizeX[1]/2. - FrameWidth[1]) / (zfront[setupid] + ilayer * LayerThickness) );
-          //            cout << "layer " << ilayer << " - angle " << frameangle[ilayer] * 180 / acos(-1) << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1]);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness);
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //
-          //            xPos = (DetectorSizeX[1]/2. - FrameWidth[1])  - ( tan( frameangle[3] ) * (zfront[setupid] + ilayer * LayerThickness) );   // shift module along x-axis
-          //            cout << "layer " << ilayer << " - xPos " << xPos << endl;
-          //	  }
-
-          cout << "DESH layer " << layerId << " xPos " << xPos << endl;
-          cout << "DESH layer " << layerId << " yPos " << yPos << endl;
-          cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] << " " << LayerThickness / 2 << " "
-               << dz << endl;
-
-          TGeoCombiTrans* module_placement =
-            new TGeoCombiTrans(xPos, yPos, LayerPosition[layerId] + LayerThickness / 2 + dz,
-                               module_rotation);  // shift by half layer thickness
-
-          // add module to layer
-          gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-          //
-        }
-      }
-    }
-  }
-
-  //install TRD2D detectors in the TRD setup
-  Int_t type = -1;
-  if (layerId == 1 && layerType == 2) type = 10;
-  if (layerId == 0 && layerType == 2) type = 9;
-  if (type < 0) return;
-  Info("create_detector_layers", "add module[0x%p] of type[%d]", (void*) gModules[type - 1], type);
-
-  // Set positions of the TRD2D wrt front TRD1D
-  Double_t xPos = 0.5 * DetectorSizeX[2];
-
-  Double_t yPos = 2.5 * 5.12;  // check with FASPRO_width;
-  Double_t zPos = 0.;
-
-  if (layerId == 0) {
-    xPos = xPos - 35.5;
-    zPos = -2.0 + 13.5;
-  }
-  if (layerId == 1) {
-    xPos = xPos - 22.5;
-    yPos = yPos - 12.5;
-    zPos = 3.0;
-  }
-
-  // statistics per layer and module type
-  ModuleStats[layerId][type - 1]++;
-
-  module_rotation = new TGeoRotation();
-  cout << "DESH layer " << layerId << " zPos " << LayerPosition[layerId] + LayerThickness / 2 << " " << zPos << endl;
-  TGeoCombiTrans* module_placement =
-    new TGeoCombiTrans(xPos, yPos, /*LayerPosition[0] - (layerId - 1) * LayerThickness / 2 + zPos*/
-                       LayerPosition[layerId] + LayerThickness / 2 + zPos,
-                       module_rotation);  // shift by half layer thickness
-  Int_t copy = copy_nr(1, 1, 0, PlaneId[layerId], 1);
-  gGeoMan->GetVolume(layername)->AddNode(gModules[type - 1], copy, module_placement);
-}
-
-
-void create_mag_field_vector()
-{
-  const TString cbmfield_01 = "cbm_field";
-  TGeoVolume* cbmfield_1    = new TGeoVolumeAssembly(cbmfield_01);
-
-  TGeoMedium* copperVolMed = gGeoMan->GetMedium(PadCopperVolumeMedium);  // define Volume Medium
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* rotx270 = new TGeoRotation("rotx270");
-  rotx270->RotateX(270.);  // rotate 270 deg around x-axis
-
-  Int_t tube_length = 500;
-  Int_t cone_length = 120;
-  Int_t cone_width  = 280;
-
-  // field tube
-  TGeoTube* trd_field          = new TGeoTube("", 0., 100 / 2., tube_length / 2.);
-  TGeoVolume* trdmod1_fieldvol = new TGeoVolume("tube", trd_field, copperVolMed);
-  trdmod1_fieldvol->SetLineColor(kRed);
-  trdmod1_fieldvol->SetTransparency(30);                                   // transparency for the TRD
-  TGeoTranslation* trd_field_trans = new TGeoTranslation("", 0., 0., 0.);  // tube position
-  cbmfield_1->AddNode(trdmod1_fieldvol, 1, trd_field_trans);
-
-  // field cone
-  TGeoCone* trd_cone          = new TGeoCone("", cone_length / 2., 0., cone_width / 2., 0., 0.);
-  TGeoVolume* trdmod1_conevol = new TGeoVolume("cone", trd_cone, copperVolMed);
-  trdmod1_conevol->SetLineColor(kRed);
-  trdmod1_conevol->SetTransparency(30);  // transparency for the TRD
-  TGeoTranslation* trd_cone_trans = new TGeoTranslation("", 0., 0., (tube_length + cone_length) / 2.);  // cone position
-  cbmfield_1->AddNode(trdmod1_conevol, 1, trd_cone_trans);
-
-  TGeoCombiTrans* field_combi01 = new TGeoCombiTrans(0., 0., 40., rotx270);  // point in +y direction
-  gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 1, field_combi01);
-
-  //   TGeoCombiTrans* field_combi02 = new TGeoCombiTrans( 200., 0., 0., rotx090);   // point in -y direction
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(cbmfield_1, 2, field_combi02);
-}
-
-
-void create_gibbet_support()
-{
-  const TString gibbet_01 = "gibbet_bars_trd1";
-  TGeoVolume* gibbet_1    = new TGeoVolumeAssembly(gibbet_01);
-
-  TGeoBBox* gibbet1;
-  TGeoBBox* gibbet2;
-  TGeoBBox* gibbet3;
-  TGeoBBox* gibbet4;
-
-  TGeoVolume* gibbet1_vol;
-  TGeoVolume* gibbet2_vol;
-  TGeoVolume* gibbet3_vol;
-  TGeoVolume* gibbet4_vol;
-
-  TGeoTranslation* gibbet1_trans;
-  TGeoTranslation* gibbet2_trans;
-  TGeoTranslation* gibbet3_trans;
-  TGeoTranslation* gibbet4_trans;
-  TGeoTranslation* gibbet5_trans;
-
-  Int_t x_offset = 0.0;  // x position of gibbet rim towards module
-  //  Int_t x_offset = -10.0; // x position of gibbet rim towards module
-
-  const Int_t kColor1010n = kAzure + 8;  // gibbet color
-  const Int_t kColor1010s = kGray;       // gibbet color
-  const Int_t kColor0305n = kBlue;       // gibbet color
-
-  TGeoMedium* k1010nVolMed = gGeoMan->GetMedium(Kanya10x10nVolumeMedium);
-  TGeoMedium* k1010sVolMed = gGeoMan->GetMedium(Kanya10x10sVolumeMedium);
-  TGeoMedium* k0305nVolMed = gGeoMan->GetMedium(Kanya03x05nVolumeMedium);
-
-  const Int_t kanya01 = 105;  // kanyahoritop
-  const Int_t kanya02 = 90;   // kanyavertnear
-  const Int_t kanya03 = 150;  // kanyavertpill
-
-  const Int_t gapx     = 5;  // gap in x direction
-  const Int_t gapy     = 2;  // gap in y direction
-  const Int_t gapxpill = 2;  // gap in x direction between vertical pillars
-
-  // horizontal gibbet 2020
-  gibbet1     = new TGeoBBox("gibbet1", kanya01 / 2., gibbet_width / 2., gibbet_thickness / 2.);
-  gibbet1_vol = new TGeoVolume("gibbetvol1", gibbet1, k1010nVolMed);
-  gibbet1_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet1_trans = new TGeoTranslation("", (kanya01 - DetectorSizeX[1]) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] + gibbet_width) / 2. + gapy, 0.);
-  gibbet_1->AddNode(gibbet1_vol, 1, gibbet1_trans);
-
-  // vertical gibbet 2020
-  gibbet2     = new TGeoBBox("gibbet2", gibbet_width / 2., kanya02 / 2., gibbet_thickness / 2.);
-  gibbet2_vol = new TGeoVolume("gibbetvol2", gibbet2, k1010nVolMed);
-  gibbet2_vol->SetLineColor(kColor1010n);
-
-  // translations
-  gibbet2_trans = new TGeoTranslation("", -(DetectorSizeX[1] + gibbet_width) / 2. - gapx + x_offset,
-                                      (DetectorSizeY[1] - kanya02) / 2. + gapy + 2 * gibbet_width, 0.);
-  gibbet_1->AddNode(gibbet2_vol, 2, gibbet2_trans);
-
-  // vertical gibbet pillar 2020
-  gibbet3     = new TGeoBBox("gibbet3", gibbet_width / 2., kanya03 / 2., gibbet_thickness / 2.);
-  gibbet3_vol = new TGeoVolume("gibbetvol3", gibbet3, k1010sVolMed);
-  gibbet3_vol->SetLineColor(kColor1010s);
-
-  // translations
-  gibbet3_trans =
-    new TGeoTranslation("", -(DetectorSizeX[1] + 3 * gibbet_width) / 2. - gapx - gapxpill + x_offset, 0., 0.);
-  gibbet_1->AddNode(gibbet3_vol, 3, gibbet3_trans);
-
-  // vertical mount rails 2020
-  gibbet4     = new TGeoBBox("gibbet4", rail_width / 2., (DetectorSizeY[1] + gapy) / 2., rail_thickness / 2.);
-  gibbet4_vol = new TGeoVolume("gibbetvol4", gibbet4, k0305nVolMed);
-  gibbet4_vol->SetLineColor(kColor0305n);
-
-  // translations
-  gibbet4_trans = new TGeoTranslation("", -(DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 4, gibbet4_trans);
-
-  // translations
-  gibbet5_trans = new TGeoTranslation("", (DetectorSizeX[1] - rail_width) / 2. + x_offset, +gapy / 2., 0.);
-  gibbet_1->AddNode(gibbet4_vol, 5, gibbet5_trans);
-
-  Int_t l;
-  Double_t xPos = 0;
-  Double_t yPos = 0;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      // DESH
-      if (l == 2) {
-        xPos = -22;  // offset in x of 1st large TRD in mCBM 2021_07
-        yPos = -0.5;
-      }  // offset in x of 1st large TRD in mCBM 2021_07
-      if (l == 3) {
-        xPos = -19;  // offset in x of 2nd large TRD in mCBM 2021_07
-        yPos = 4.5;
-      }  // offset in x of 2nd large TRD in mCBM 2021_07
-      TGeoTranslation* gibbet_placement =
-        new TGeoTranslation(xPos, yPos, LayerPosition[l] + LayerThickness / 2. + gibbet_position);
-      gGeoMan->GetVolume(layername)->AddNode(gibbet_1, l, gibbet_placement);
-    }
-}
-
-
-void create_power_bars_vertical()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - horizontal short
-  power1     = new TGeoBBox("power1", (DetectorSizeX[1] - DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1 * (DetectorSizeX[1] - DetectorSizeY[0] / 2.), -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - horizontal long
-  power1 =
-    new TGeoBBox("power1", (DetectorSizeX[0] - powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", -1 * DetectorSizeX[0], 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", 1 * DetectorSizeX[0], -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - vertical long
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (5 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 3.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 5, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 0., 0.);
-  power_1->AddNode(power2_vol, 6, power2_trans);
-
-  // powerbus - vertical middle
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (3 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[0], 0., 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - vertical short 1
-  power2     = new TGeoBBox("power2", powerbar_width / 2., 1 * DetectorSizeY[1] / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], (2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], -(2.0 * DetectorSizeY[1] + powerbar_width / 2.), 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - vertical short 2
-  power2 =
-    new TGeoBBox("power2", powerbar_width / 2., (1 * DetectorSizeY[1] + powerbar_width) / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[1], -2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[1], 2.0 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - vertical short 3
-  power2     = new TGeoBBox("power2", powerbar_width / 2., (2 * DetectorSizeY[0] + powerbar_width / 2.) / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -0.5 * DetectorSizeX[0], (1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 0.5 * DetectorSizeX[0], -(1.5 * DetectorSizeY[0] + powerbar_width / 4.), 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 1))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_power_bars_horizontal()
-{
-  const TString power_01 = "power_bars_trd1";
-  TGeoVolume* power_1    = new TGeoVolumeAssembly(power_01);
-
-  TGeoBBox* power1;
-  TGeoBBox* power2;
-
-  TGeoVolume* power1_vol;
-  TGeoVolume* power2_vol;
-
-  TGeoTranslation* power1_trans;
-  TGeoTranslation* power2_trans;
-
-  const Int_t kColor = kBlue;  // bus bar color
-
-  TGeoMedium* powerBusVolMed = gGeoMan->GetMedium(PowerBusVolumeMedium);
-
-  // powerbus - vertical short
-  power1     = new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[1] - DetectorSizeY[0] - powerbar_width) / 2.,
-                        powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], -1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 1, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], 1 * (DetectorSizeY[1] - DetectorSizeY[0] / 2.), 0.);
-  power_1->AddNode(power1_vol, 2, power1_trans);
-
-  // powerbus - vertical long
-  power1 =
-    new TGeoBBox("power1", powerbar_width / 2., (DetectorSizeY[0] - powerbar_width) / 2., powerbar_thickness / 2.);
-  power1_vol = new TGeoVolume("powerbus1", power1, powerBusVolMed);
-  power1_vol->SetLineColor(kColor);
-
-  // translations
-  power1_trans = new TGeoTranslation("", 1.5 * DetectorSizeX[1], 1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 3, power1_trans);
-
-  power1_trans = new TGeoTranslation("", -1.5 * DetectorSizeX[1], -1 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power1_vol, 4, power1_trans);
-
-
-  // powerbus - horizontal long
-  power2 =
-    new TGeoBBox("power2", (7 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 1, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 2.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 2, power2_trans);
-
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 3, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 4, power2_trans);
-
-  // powerbus - horizontal middle
-  power2 =
-    new TGeoBBox("power2", (3 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", 0., -1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 7, power2_trans);
-  power2_trans = new TGeoTranslation("", 0., 1.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 8, power2_trans);
-
-  // powerbus - horizontal short 1
-  power2     = new TGeoBBox("power2", 2 * DetectorSizeX[1] / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-  //  power2_vol->SetLineColor(kRed);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (2.5 * DetectorSizeX[1] + powerbar_width / 2.), 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 9, power2_trans);
-  power2_trans = new TGeoTranslation("", -(2.5 * DetectorSizeX[1] + powerbar_width / 2.), -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 10, power2_trans);
-
-  // powerbus - horizontal short 2
-  power2 =
-    new TGeoBBox("power2", (2 * DetectorSizeX[1] + powerbar_width) / 2., powerbar_width / 2., powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", -2.5 * DetectorSizeX[1], 0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", 2.5 * DetectorSizeX[1], -0.5 * DetectorSizeY[1], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  // powerbus - horizontal short 3
-  power2     = new TGeoBBox("power2", (2 * DetectorSizeX[0] + powerbar_width / 2.) / 2., powerbar_width / 2.,
-                        powerbar_thickness / 2.);
-  power2_vol = new TGeoVolume("powerbus2", power2, powerBusVolMed);
-  power2_vol->SetLineColor(kColor);
-
-  // translations
-  power2_trans = new TGeoTranslation("", (1.5 * DetectorSizeX[0] + powerbar_width / 4.), 0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 11, power2_trans);
-  power2_trans = new TGeoTranslation("", -(1.5 * DetectorSizeX[0] + powerbar_width / 4.), -0.5 * DetectorSizeY[0], 0.);
-  power_1->AddNode(power2_vol, 12, power2_trans);
-
-  Int_t l;
-  for (l = 0; l < 4; l++)
-    if ((ShowLayer[l]) && (BusBarOrientation[l] == 0))  // if geometry contains layer l
-    {
-      TString layername = Form("layer%02d", l + 1);
-      TGeoTranslation* power_placement =
-        new TGeoTranslation(0, 0, LayerPosition[l] + LayerThickness / 2. + powerbar_position);
-      gGeoMan->GetVolume(layername)->AddNode(power_1, l, power_placement);
-    }
-}
-
-
-void create_xtru_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Double_t x[12] = {-15, -15, -1, -1, -15, -15, 15, 15, 1, 1, 15, 15};  // IPB 400
-  const Double_t y[12] = {-20, -18, -18, 18,  18,  20,
-                          20,  18,  18,  -18, -18, -20};  // 30 x 40 cm in size, 2 cm wall thickness
-  const Double_t Hwid  = -2 * x[0];                       // 30
-  const Double_t Hhei  = -2 * y[0];                       // 40
-
-  Double_t AperX[3] = {450., 550., 600.};  // inner aperture in X of support structure for stations 1,2,3
-  Double_t AperY[3] = {350., 450., 500.};  // inner aperture in Y of support structure for stations 1,2,3
-  Double_t PilPosX;
-  Double_t BarPosY;
-
-  const Double_t BeamHeight = 570;  // beamline is at 5.7m above floor
-
-  Double_t PilPosZ[6];  // PilPosZ
-                        //  PilPosZ[0] = LayerPosition[0] + LayerThickness/2.;
-                        //  PilPosZ[1] = LayerPosition[3] + LayerThickness/2.;
-                        //  PilPosZ[2] = LayerPosition[4] + LayerThickness/2.;
-                        //  PilPosZ[3] = LayerPosition[7] + LayerThickness/2.;
-                        //  PilPosZ[4] = LayerPosition[8] + LayerThickness/2.;
-                        //  PilPosZ[5] = LayerPosition[9] + LayerThickness/2.;
-
-  PilPosZ[0] = LayerPosition[0] + 15;
-  PilPosZ[1] = LayerPosition[3] - 15 + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + 15;
-  PilPosZ[3] = LayerPosition[7] - 15 + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + 15;
-  PilPosZ[5] = LayerPosition[9] - 15 + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  //  TGeoRotation  *rotxz01 = new TGeoRotation("rotxz01");
-  //  rotxz01->RotateX(  90.); // rotate  90 deg around x-axis
-  //  rotxz01->RotateZ(  90.); // rotate  90 deg around z-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[0] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_01", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 11, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 12, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 13, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[1], rotzx01);
-    trd_1->AddNode(trd_H_vert_vol1, 14, trd_H_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[1] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_02", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 21, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 22, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 23, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[3], rotzx01);
-    trd_2->AddNode(trd_H_vert_vol1, 24, trd_H_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_vert1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_vert1->DefinePolygon(12, x, y);
-    trd_H_vert1->DefineSection(0, -(AperY[2] + Hhei), 0, 0, 1.0);
-    trd_H_vert1->DefineSection(1, BeamHeight, 0, 0, 1.0);
-    TGeoVolume* trd_H_vert_vol1 = new TGeoVolume("trd_H_y_03", trd_H_vert1, aluminiumVolMed);
-    trd_H_vert_vol1->SetLineColor(kYellow);
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_H_vert_combi01 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 31, trd_H_vert_combi01);
-    TGeoCombiTrans* trd_H_vert_combi02 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 32, trd_H_vert_combi02);
-    TGeoCombiTrans* trd_H_vert_combi03 = new TGeoCombiTrans((PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 33, trd_H_vert_combi03);
-    TGeoCombiTrans* trd_H_vert_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), 0., PilPosZ[5], rotzx01);
-    trd_3->AddNode(trd_H_vert_vol1, 34, trd_H_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[0], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[0], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_01", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 11, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[0], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 12, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 13, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[1], roty090);
-    trd_1->AddNode(trd_H_hori_vol1, 14, trd_H_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[1], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[1], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_02", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 21, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[2], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 22, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 23, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[3], roty090);
-    trd_2->AddNode(trd_H_hori_vol1, 24, trd_H_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_hori1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_hori1->DefinePolygon(12, x, y);
-    trd_H_hori1->DefineSection(0, -AperX[2], 0, 0, 1.0);
-    trd_H_hori1->DefineSection(1, AperX[2], 0, 0, 1.0);
-    TGeoVolume* trd_H_hori_vol1 = new TGeoVolume("trd_H_x_03", trd_H_hori1, aluminiumVolMed);
-    trd_H_hori_vol1->SetLineColor(kRed);
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_hori_combi01 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 31, trd_H_hori_combi01);
-    TGeoCombiTrans* trd_H_hori_combi02 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[4], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 32, trd_H_hori_combi02);
-    TGeoCombiTrans* trd_H_hori_combi03 = new TGeoCombiTrans(0., (BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 33, trd_H_hori_combi03);
-    TGeoCombiTrans* trd_H_hori_combi04 = new TGeoCombiTrans(0., -(BarPosY + Hhei / 2.), PilPosZ[5], roty090);
-    trd_3->AddNode(trd_H_hori_vol1, 34, trd_H_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[1] - PilPosZ[0] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_01", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[0];
-    BarPosY = AperY[0];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 11, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 12, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 13, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_H_slope_vol1, 14, trd_H_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[3] - PilPosZ[2] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_02", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[1];
-    BarPosY = AperY[1];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 21, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 22, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 23, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_H_slope_vol1, 24, trd_H_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoXtru* trd_H_slope1 = new TGeoXtru(2);  // define Xtrusion of 2 planes
-    trd_H_slope1->DefinePolygon(12, x, y);
-    trd_H_slope1->DefineSection(0, -(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    trd_H_slope1->DefineSection(1, +(PilPosZ[5] - PilPosZ[4] - Hwid) / 2., 0, 0, 1.0);
-    TGeoVolume* trd_H_slope_vol1 = new TGeoVolume("trd_H_z_03", trd_H_slope1, aluminiumVolMed);
-    trd_H_slope_vol1->SetLineColor(kGreen);
-    PilPosX = AperX[2];
-    BarPosY = AperY[2];
-
-    TGeoCombiTrans* trd_H_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 31, trd_H_slope_combi01);
-    TGeoCombiTrans* trd_H_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + Hhei / 2.), (BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 32, trd_H_slope_combi02);
-    TGeoCombiTrans* trd_H_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 33, trd_H_slope_combi03);
-    TGeoCombiTrans* trd_H_slope_combi04 = new TGeoCombiTrans(-(PilPosX + Hhei / 2.), -(BarPosY + Hhei - Hwid / 2.),
-                                                             (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_H_slope_vol1, 34, trd_H_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 =
-      new TGeoTranslation(0., (AperY[0] + Hhei + text_height / 2.), PilPosZ[0] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr201 =
-      new TGeoTranslation(0., (AperY[1] + Hhei + text_height / 2.), PilPosZ[2] - 15 + text_thickness / 2.);
-    TGeoTranslation* tr202 =
-      new TGeoTranslation(0., (AperY[2] + Hhei + text_height / 2.), PilPosZ[4] - 15 + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + Hhei + text_thickness / 2.), (AperY[0] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + Hhei + text_thickness / 2.), (AperY[1] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + Hhei + text_thickness / 2.), (AperY[2] + Hhei - Hwid - text_height / 2.),
-                         (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  //  gGeoMan->GetVolume(geoVersion)->AddNode(trdsupport,1);
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
-
-
-void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-{
-  // write TRD (the 3 characters) in a simple geometry
-  TGeoMedium* textVolMed = gGeoMan->GetMedium(TextVolumeMedium);
-
-  Int_t Tcolor = kBlue;  // kRed;
-  Int_t Rcolor = kBlue;  // kRed;  // kRed;
-  Int_t Dcolor = kBlue;  // kRed;  // kYellow;
-  Int_t Icolor = kBlue;  // kRed;
-
-  // define transformations for letter pieces
-  // T
-  TGeoTranslation* tr01 = new TGeoTranslation(0., -4., 0.);
-  TGeoTranslation* tr02 = new TGeoTranslation(0., 16., 0.);
-
-  // R
-  TGeoTranslation* tr11 = new TGeoTranslation(10, 0., 0.);
-  TGeoTranslation* tr12 = new TGeoTranslation(2, 0., 0.);
-  TGeoTranslation* tr13 = new TGeoTranslation(2, 16., 0.);
-  TGeoTranslation* tr14 = new TGeoTranslation(-2, 8., 0.);
-  TGeoTranslation* tr15 = new TGeoTranslation(-6, 0., 0.);
-
-  // D
-  TGeoTranslation* tr21 = new TGeoTranslation(12., 0., 0.);
-  TGeoTranslation* tr22 = new TGeoTranslation(6., 16., 0.);
-  TGeoTranslation* tr23 = new TGeoTranslation(6., -16., 0.);
-  TGeoTranslation* tr24 = new TGeoTranslation(4., 0., 0.);
-
-  // I
-  TGeoTranslation* tr31 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr32 = new TGeoTranslation(0., 16., 0.);
-  TGeoTranslation* tr33 = new TGeoTranslation(0., -16., 0.);
-
-  // make letter T
-  //   TGeoVolume *T = geom->MakeBox("T", Vacuum, 25., 25., 5.);
-  //   T->SetVisibility(kFALSE);
-  TGeoVolume* T = new TGeoVolumeAssembly("Tbox");  // volume for T
-
-  TGeoBBox* Tbar1b  = new TGeoBBox("trd_Tbar1b", 4., 16., 4.);  // | vertical
-  TGeoVolume* Tbar1 = new TGeoVolume("Tbar1", Tbar1b, textVolMed);
-  Tbar1->SetLineColor(Tcolor);
-  T->AddNode(Tbar1, 1, tr01);
-  TGeoBBox* Tbar2b  = new TGeoBBox("trd_Tbar2b", 16, 4., 4.);  // - top
-  TGeoVolume* Tbar2 = new TGeoVolume("Tbar2", Tbar2b, textVolMed);
-  Tbar2->SetLineColor(Tcolor);
-  T->AddNode(Tbar2, 1, tr02);
-
-  // make letter R
-  //   TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-  //   R->SetVisibility(kFALSE);
-  TGeoVolume* R = new TGeoVolumeAssembly("Rbox");  // volume for R
-
-  TGeoBBox* Rbar1b  = new TGeoBBox("trd_Rbar1b", 4., 20, 4.);
-  TGeoVolume* Rbar1 = new TGeoVolume("Rbar1", Rbar1b, textVolMed);
-  Rbar1->SetLineColor(Rcolor);
-  R->AddNode(Rbar1, 1, tr11);
-  TGeoBBox* Rbar2b  = new TGeoBBox("trd_Rbar2b", 4., 4., 4.);
-  TGeoVolume* Rbar2 = new TGeoVolume("Rbar2", Rbar2b, textVolMed);
-  Rbar2->SetLineColor(Rcolor);
-  R->AddNode(Rbar2, 1, tr12);
-  R->AddNode(Rbar2, 2, tr13);
-  TGeoTubeSeg* Rtub1b = new TGeoTubeSeg("trd_Rtub1b", 4., 12, 4., 90., 270.);
-  TGeoVolume* Rtub1   = new TGeoVolume("Rtub1", (TGeoShape*) Rtub1b, textVolMed);
-  Rtub1->SetLineColor(Rcolor);
-  R->AddNode(Rtub1, 1, tr14);
-  TGeoArb8* Rbar3b  = new TGeoArb8("trd_Rbar3b", 4.);
-  TGeoVolume* Rbar3 = new TGeoVolume("Rbar3", Rbar3b, textVolMed);
-  Rbar3->SetLineColor(Rcolor);
-  TGeoArb8* arb = (TGeoArb8*) Rbar3->GetShape();
-  arb->SetVertex(0, 12., -4.);
-  arb->SetVertex(1, 0., -20.);
-  arb->SetVertex(2, -8., -20.);
-  arb->SetVertex(3, 4., -4.);
-  arb->SetVertex(4, 12., -4.);
-  arb->SetVertex(5, 0., -20.);
-  arb->SetVertex(6, -8., -20.);
-  arb->SetVertex(7, 4., -4.);
-  R->AddNode(Rbar3, 1, tr15);
-
-  // make letter D
-  //   TGeoVolume *D = geom->MakeBox("D", Vacuum, 25., 25., 5.);
-  //   D->SetVisibility(kFALSE);
-  TGeoVolume* D = new TGeoVolumeAssembly("Dbox");  // volume for D
-
-  TGeoBBox* Dbar1b  = new TGeoBBox("trd_Dbar1b", 4., 20, 4.);
-  TGeoVolume* Dbar1 = new TGeoVolume("Dbar1", Dbar1b, textVolMed);
-  Dbar1->SetLineColor(Dcolor);
-  D->AddNode(Dbar1, 1, tr21);
-  TGeoBBox* Dbar2b  = new TGeoBBox("trd_Dbar2b", 2., 4., 4.);
-  TGeoVolume* Dbar2 = new TGeoVolume("Dbar2", Dbar2b, textVolMed);
-  Dbar2->SetLineColor(Dcolor);
-  D->AddNode(Dbar2, 1, tr22);
-  D->AddNode(Dbar2, 2, tr23);
-  TGeoTubeSeg* Dtub1b = new TGeoTubeSeg("trd_Dtub1b", 12, 20, 4., 90., 270.);
-  TGeoVolume* Dtub1   = new TGeoVolume("Dtub1", (TGeoShape*) Dtub1b, textVolMed);
-  Dtub1->SetLineColor(Dcolor);
-  D->AddNode(Dtub1, 1, tr24);
-
-  // make letter I
-  TGeoVolume* I = new TGeoVolumeAssembly("Ibox");  // volume for I
-
-  TGeoBBox* Ibar1b  = new TGeoBBox("trd_Ibar1b", 4., 12., 4.);  // | vertical
-  TGeoVolume* Ibar1 = new TGeoVolume("Ibar1", Ibar1b, textVolMed);
-  Ibar1->SetLineColor(Icolor);
-  I->AddNode(Ibar1, 1, tr31);
-  TGeoBBox* Ibar2b  = new TGeoBBox("trd_Ibar2b", 10., 4., 4.);  // - top
-  TGeoVolume* Ibar2 = new TGeoVolume("Ibar2", Ibar2b, textVolMed);
-  Ibar2->SetLineColor(Icolor);
-  I->AddNode(Ibar2, 1, tr32);
-  I->AddNode(Ibar2, 2, tr33);
-
-
-  // build text block "TRD"  <32> + 8 + <28> + 8 + <32> = 108
-
-  //  TGeoBBox *trdboxb = new TGeoBBox("", 108./2, 40./2, 8./2);
-  //  TGeoVolume *trdbox = new TGeoVolume("trdboxb", trdboxb, textVolMed);
-  //  trdbox->SetVisibility(kFALSE);
-
-  //  TGeoVolume* trdbox[0] = new TGeoVolumeAssembly("trdbox1"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[1] = new TGeoVolumeAssembly("trdbox2"); // volume for TRD text (108, 40, 8)
-  //  TGeoVolume* trdbox[2] = new TGeoVolumeAssembly("trdbox3"); // volume for TRD text (108, 40, 8)
-
-  TGeoTranslation* tr100 = new TGeoTranslation(38., 0., 0.);
-  TGeoTranslation* tr101 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr102 = new TGeoTranslation(-38., 0., 0.);
-
-  //  TGeoTranslation *tr103 = new TGeoTranslation( -70., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr104 = new TGeoTranslation( -86., 0., 0.);  // on the same line
-  //  TGeoTranslation *tr105 = new TGeoTranslation(-102., 0., 0.);  // on the same line
-
-  TGeoTranslation* tr110 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr111 = new TGeoTranslation(8., -50., 0.);
-  TGeoTranslation* tr112 = new TGeoTranslation(-8., -50., 0.);
-  TGeoTranslation* tr113 = new TGeoTranslation(16., -50., 0.);
-  TGeoTranslation* tr114 = new TGeoTranslation(-16., -50., 0.);
-
-  TGeoTranslation* tr200 = new TGeoTranslation(0., 0., 0.);
-  TGeoTranslation* tr201 = new TGeoTranslation(0., -50., 0.);
-  TGeoTranslation* tr202 = new TGeoTranslation(0., -100., 0.);
-
-  TGeoTranslation* tr210 = new TGeoTranslation(0., -150., 0.);
-  TGeoTranslation* tr213 = new TGeoTranslation(16., -150., 0.);
-  TGeoTranslation* tr214 = new TGeoTranslation(-16., -150., 0.);
-
-  // station 1
-  trdbox1->AddNode(T, 1, tr100);
-  trdbox1->AddNode(R, 1, tr101);
-  trdbox1->AddNode(D, 1, tr102);
-
-  trdbox1->AddNode(I, 1, tr110);
-
-  // station 2
-  trdbox2->AddNode(T, 1, tr100);
-  trdbox2->AddNode(R, 1, tr101);
-  trdbox2->AddNode(D, 1, tr102);
-
-  trdbox2->AddNode(I, 1, tr111);
-  trdbox2->AddNode(I, 2, tr112);
-
-  //// station 3
-  //  trdbox3->AddNode(T, 1, tr100);
-  //  trdbox3->AddNode(R, 1, tr101);
-  //  trdbox3->AddNode(D, 1, tr102);
-  //
-  //  trdbox3->AddNode(I, 1, tr110);
-  //  trdbox3->AddNode(I, 2, tr113);
-  //  trdbox3->AddNode(I, 3, tr114);
-
-  // station 3
-  trdbox3->AddNode(T, 1, tr200);
-  trdbox3->AddNode(R, 1, tr201);
-  trdbox3->AddNode(D, 1, tr202);
-
-  trdbox3->AddNode(I, 1, tr210);
-  trdbox3->AddNode(I, 2, tr213);
-  trdbox3->AddNode(I, 3, tr214);
-
-  //  TGeoScale *sc100 = new TGeoScale( 36./50., 36./50., 1.);  // text is vertical 50 cm, H-bar opening is 36 cm
-  //
-  //  // scale text
-  //  TGeoHMatrix *mat100 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat101 = new TGeoHMatrix("");
-  //  TGeoHMatrix *mat102 = new TGeoHMatrix("");
-  //  (*mat100) = (*tr100) * (*sc100);
-  //  (*mat101) = (*tr101) * (*sc100);
-  //  (*mat102) = (*tr102) * (*sc100);
-  //
-  //  trdbox->AddNode(T, 1, mat100);
-  //  trdbox->AddNode(R, 1, mat101);
-  //  trdbox->AddNode(D, 1, mat102);
-
-  //   // final placement
-  //   //   TGeoTranslation *tr103 = new TGeoTranslation(0., 400., 500.);
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 1, new TGeoTranslation(0., 400., 500.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 2, new TGeoTranslation(0., 500., 600.));
-  //   gGeoMan->GetVolume(geoVersion)->AddNode(trdbox, 3, new TGeoTranslation(0., 600., 700.));
-
-  //  return trdbox;
-}
-
-
-void create_box_supports()
-{
-  const TString trd_01 = "support_trd1";
-  TGeoVolume* trd_1    = new TGeoVolumeAssembly(trd_01);
-
-  const TString trd_02 = "support_trd2";
-  TGeoVolume* trd_2    = new TGeoVolumeAssembly(trd_02);
-
-  const TString trd_03 = "support_trd3";
-  TGeoVolume* trd_3    = new TGeoVolumeAssembly(trd_03);
-
-  //  const TString trdSupport = "supportframe";
-  //  TGeoVolume* trdsupport = new TGeoVolumeAssembly(trdSupport);
-  //
-  //  trdsupport->AddNode(trd_1, 1);
-  //  trdsupport->AddNode(trd_2, 2);
-  //  trdsupport->AddNode(trd_3, 3);
-
-  TGeoMedium* keepVolMed      = gGeoMan->GetMedium(KeepingVolumeMedium);
-  TGeoMedium* aluminiumVolMed = gGeoMan->GetMedium(AluminiumVolumeMedium);  // define Volume Medium
-
-  const Int_t I_height = 40;  // cm // I profile properties
-  const Int_t I_width  = 30;  // cm // I profile properties
-  const Int_t I_thick  = 2;   // cm // I profile properties
-
-  const Double_t BeamHeight     = 570;  // beamline is at 5.7m above the floor
-  const Double_t PlatformHeight = 234;  // platform is   2.34m above the floor
-  const Double_t PlatformOffset = 1;    // distance to platform
-
-  //  Double_t AperX[3] = { 450., 550., 600.};  // 100 cm modules  // inner aperture in X of support structure for stations 1,2,3
-  //  Double_t AperY[3] = { 350., 450., 500.};  // 100 cm modules  // inner aperture in Y of support structure for stations 1,2,3
-
-  const Double_t AperX[3] = {4.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1],
-                             6 * DetectorSizeX[1]};  // inner aperture in X of support structure for stations 1,2,3
-  const Double_t AperY[3] = {3.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1],
-                             5 * DetectorSizeY[1]};  // inner aperture in Y of support structure for stations 1,2,3
-  // platform
-  const Double_t AperYbot[3] = {BeamHeight - (PlatformHeight + PlatformOffset + I_height), 4.5 * DetectorSizeY[1],
-                                5 * DetectorSizeY[1]};  // inner aperture for station1
-
-  const Double_t xBarPosYtop[3] = {AperY[0] + I_height / 2., AperY[1] + I_height / 2., AperY[2] + I_height / 2.};
-  const Double_t xBarPosYbot[3] = {AperYbot[0] + I_height / 2., xBarPosYtop[1], xBarPosYtop[2]};
-
-  const Double_t zBarPosYtop[3] = {AperY[0] + I_height - I_width / 2., AperY[1] + I_height - I_width / 2.,
-                                   AperY[2] + I_height - I_width / 2.};
-  const Double_t zBarPosYbot[3] = {AperYbot[0] + I_height - I_width / 2., zBarPosYtop[1], zBarPosYtop[2]};
-
-  Double_t PilPosX;
-  Double_t PilPosZ[6];  // PilPosZ
-
-  PilPosZ[0] = LayerPosition[0] + I_width / 2.;
-  PilPosZ[1] = LayerPosition[3] - I_width / 2. + LayerThickness;
-  PilPosZ[2] = LayerPosition[4] + I_width / 2.;
-  PilPosZ[3] = LayerPosition[7] - I_width / 2. + LayerThickness;
-  PilPosZ[4] = LayerPosition[8] + I_width / 2.;
-  PilPosZ[5] = LayerPosition[9] - I_width / 2. + LayerThickness;
-
-  //  cout << "PilPosZ[0]: " << PilPosZ[0] << endl;
-  //  cout << "PilPosZ[1]: " << PilPosZ[1] << endl;
-
-  TGeoRotation* rotx090 = new TGeoRotation("rotx090");
-  rotx090->RotateX(90.);  // rotate  90 deg around x-axis
-  TGeoRotation* roty090 = new TGeoRotation("roty090");
-  roty090->RotateY(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* rotz090 = new TGeoRotation("rotz090");
-  rotz090->RotateZ(90.);  // rotate  90 deg around y-axis
-  TGeoRotation* roty270 = new TGeoRotation("roty270");
-  roty270->RotateY(270.);  // rotate 270 deg around y-axis
-
-  TGeoRotation* rotzx01 = new TGeoRotation("rotzx01");
-  rotzx01->RotateZ(90.);  // rotate  90 deg around z-axis
-  rotzx01->RotateX(90.);  // rotate  90 deg around x-axis
-
-  TGeoRotation* rotzx02 = new TGeoRotation("rotzx02");
-  rotzx02->RotateZ(270.);  // rotate 270 deg around z-axis
-  rotzx02->RotateX(90.);   // rotate  90 deg around x-axis
-
-  Double_t ang1 = atan(3. / 4.) * 180. / acos(-1.);
-  //  cout << "DEDE " << ang1 << endl;
-  //  Double_t sin1 = acos(-1.);
-  //  cout << "DEDE " << sin1 << endl;
-  TGeoRotation* rotx080 = new TGeoRotation("rotx080");
-  rotx080->RotateX(90. - ang1);  // rotate  80 deg around x-axis
-  TGeoRotation* rotx100 = new TGeoRotation("rotx100");
-  rotx100->RotateX(90. + ang1);  // rotate 100 deg around x-axis
-
-  TGeoRotation* rotxy01 = new TGeoRotation("rotxy01");
-  rotxy01->RotateX(90.);    // rotate  90 deg around x-axis
-  rotxy01->RotateZ(-ang1);  // rotate  ang1   around rotated y-axis
-
-  TGeoRotation* rotxy02 = new TGeoRotation("rotxy02");
-  rotxy02->RotateX(90.);   // rotate  90 deg around x-axis
-  rotxy02->RotateZ(ang1);  // rotate  ang1   around rotated y-axis
-
-
-  //-------------------
-  // vertical pillars (Y)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    //      TGeoBBox* trd_I_vert1_keep  = new TGeoBBox("", I_thick /2., I_height /2. - I_thick, (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y11", trd_I_vert1_keep, aluminiumVolMed);
-    //      TGeoBBox* trd_I_vert2_keep  = new TGeoBBox("", I_width /2.,            I_thick /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert2_keep = new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2.,
-                                              ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2    = new TGeoVolume("trd_I_y12", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-    trd_I_vert2->SetLineColor(kGreen);  // kBlue);  // Yellow);  // kOrange);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    //      TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("", I_width /2., I_height /2., (BeamHeight + (AperY[0]+I_height) ) /2.);
-    TGeoBBox* trd_I_vert_vol1_keep = new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2.,
-                                                  ((AperYbot[0] + I_height) + (AperY[0] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1    = new TGeoVolume("trd_I_y10", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y13", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    //      TGeoTranslation *ty04 = new TGeoTranslation("ty04",  (I_thick/2. + (I_width-I_thick)/2./2.), 0., -( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // top
-    //      TGeoTranslation *ty05 = new TGeoTranslation("ty05",  (I_thick/2. + (I_width-I_thick)/2./2.), 0.,  ( (AperYbot[0]+I_height) + (AperY[0]+I_height) - I_width) /2.);  // bottom
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                (zBarPosYbot[0] + zBarPosYtop[0]) / 2.);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_vert_combi01 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 11, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[0], rotzx01);
-    trd_1->AddNode(trd_I_vert_vol1, 12, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 = new TGeoCombiTrans(
-      (PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 13, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 = new TGeoCombiTrans(
-      -(PilPosX + I_height / 2.), -((AperYbot[0] + I_height) - (AperY[0] + I_height)) / 2., PilPosZ[1], rotzx02);
-    trd_1->AddNode(trd_I_vert_vol1, 14, trd_I_vert_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y21", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y22", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[1] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y20", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y23", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[1] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[1] + I_height)) / 2. + zBarPosYbot[1]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 21, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[2], rotzx01);
-    trd_2->AddNode(trd_I_vert_vol1, 22, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 23, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[1] + I_height)) / 2., PilPosZ[3], rotzx02);
-    trd_2->AddNode(trd_I_vert_vol1, 24, trd_I_vert_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_vert1_keep = new TGeoBBox("trd_I_vert1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                              (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert1    = new TGeoVolume("trd_I_y31", trd_I_vert1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_vert2_keep =
-      new TGeoBBox("trd_I_vert2_keep", I_width / 2., I_thick / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert2 = new TGeoVolume("trd_I_y32", trd_I_vert2_keep, aluminiumVolMed);
-
-    trd_I_vert1->SetLineColor(kGreen);
-    trd_I_vert2->SetLineColor(kGreen);
-
-    TGeoTranslation* ty01 = new TGeoTranslation("ty01", 0., 0., 0.);
-    TGeoTranslation* ty02 = new TGeoTranslation("ty02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* ty03 = new TGeoTranslation("ty03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_vert_vol1_keep =
-      new TGeoBBox("trd_I_vert_vol1_keep", I_width / 2., I_height / 2., (BeamHeight + (AperY[2] + I_height)) / 2.);
-    TGeoVolume* trd_I_vert_vol1 = new TGeoVolume("trd_I_y30", trd_I_vert_vol1_keep, keepVolMed);
-
-    // set green color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_vert_vol1->SetLineColor(kGreen);
-
-    // build I-bar trd_I_vert_vol1
-    trd_I_vert_vol1->AddNode(trd_I_vert1, 1, ty01);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 2, ty02);
-    trd_I_vert_vol1->AddNode(trd_I_vert2, 3, ty03);
-
-    // close gap to horizontal z-bars
-    TGeoBBox* trd_I_vert3_keep =
-      new TGeoBBox("trd_I_vert3_keep", (I_width - I_thick) / 2. / 2., I_height / 2. - I_thick, I_thick / 2.);
-    TGeoVolume* trd_I_vert3 = new TGeoVolume("trd_I_y33", trd_I_vert3_keep, aluminiumVolMed);
-    trd_I_vert3->SetLineColor(kGreen);
-    TGeoTranslation* ty04 = new TGeoTranslation("ty04", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight + (AperY[2] + I_height) - I_width) / 2.);  // top
-    TGeoTranslation* ty05 = new TGeoTranslation("ty05", (I_thick / 2. + (I_width - I_thick) / 2. / 2.), 0.,
-                                                -(BeamHeight - (AperY[2] + I_height)) / 2. + zBarPosYbot[2]);  // bottom
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 4, ty04);
-    trd_I_vert_vol1->AddNode(trd_I_vert3, 5, ty05);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_vert_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 31, trd_I_vert_combi01);
-    TGeoCombiTrans* trd_I_vert_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[4], rotzx01);
-    trd_3->AddNode(trd_I_vert_vol1, 32, trd_I_vert_combi02);
-    TGeoCombiTrans* trd_I_vert_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 33, trd_I_vert_combi03);
-    TGeoCombiTrans* trd_I_vert_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -(BeamHeight - (AperY[2] + I_height)) / 2., PilPosZ[5], rotzx02);
-    trd_3->AddNode(trd_I_vert_vol1, 34, trd_I_vert_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (X)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[0]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x11", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[0]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x12", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);  // Yellow);
-    trd_I_hori2->SetLineColor(kRed);  // Yellow);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[0]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x10", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 11, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[0], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 12, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 13, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[0], PilPosZ[1], roty090);
-    trd_1->AddNode(trd_I_hori_vol1, 14, trd_I_hori_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[1]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x21", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[1]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x22", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[1]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x20", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 21, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[2], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 22, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 23, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[1], PilPosZ[3], roty090);
-    trd_2->AddNode(trd_I_hori_vol1, 24, trd_I_hori_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_hori1_keep = new TGeoBBox("trd_I_hori1_keep", I_thick / 2., I_height / 2. - I_thick, AperX[2]);
-    TGeoVolume* trd_I_hori1    = new TGeoVolume("trd_I_x31", trd_I_hori1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_hori2_keep = new TGeoBBox("trd_I_hori2_keep", I_width / 2., I_thick / 2., AperX[2]);
-    TGeoVolume* trd_I_hori2    = new TGeoVolume("trd_I_x32", trd_I_hori2_keep, aluminiumVolMed);
-
-    trd_I_hori1->SetLineColor(kRed);
-    trd_I_hori2->SetLineColor(kRed);
-
-    TGeoTranslation* tx01 = new TGeoTranslation("tx01", 0., 0., 0.);
-    TGeoTranslation* tx02 = new TGeoTranslation("tx02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tx03 = new TGeoTranslation("tx03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_hori_vol1_keep = new TGeoBBox("trd_I_hori_vol1_keep", I_width / 2., I_height / 2., AperX[2]);
-    TGeoVolume* trd_I_hori_vol1    = new TGeoVolume("trd_I_x30", trd_I_hori_vol1_keep, keepVolMed);
-
-    // set red color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_hori_vol1->SetLineColor(kRed);
-
-    // build I-bar trd_I_hori_vol1
-    trd_I_hori_vol1->AddNode(trd_I_hori1, 1, tx01);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 2, tx02);
-    trd_I_hori_vol1->AddNode(trd_I_hori2, 3, tx03);
-
-    TGeoCombiTrans* trd_I_hori_combi01 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 31, trd_I_hori_combi01);
-    TGeoCombiTrans* trd_I_hori_combi02 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[4], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 32, trd_I_hori_combi02);
-    TGeoCombiTrans* trd_I_hori_combi03 = new TGeoCombiTrans(0., xBarPosYtop[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 33, trd_I_hori_combi03);
-    TGeoCombiTrans* trd_I_hori_combi04 = new TGeoCombiTrans(0., -xBarPosYbot[2], PilPosZ[5], roty090);
-    trd_3->AddNode(trd_I_hori_vol1, 34, trd_I_hori_combi04);
-  }
-
-
-  //-------------------
-  // horizontal supports (Z)
-  //-------------------
-
-  // station 1
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z11", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z12", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[1] - PilPosZ[0] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z10", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[0];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 11, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 12, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 13, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[0], (PilPosZ[0] + PilPosZ[1]) / 2., rotz090);
-    trd_1->AddNode(trd_I_slope_vol1, 14, trd_I_slope_combi04);
-  }
-
-  // station 2
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z21", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z22", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[3] - PilPosZ[2] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z20", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[1];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 21, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 22, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 23, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[1], (PilPosZ[2] + PilPosZ[3]) / 2., rotz090);
-    trd_2->AddNode(trd_I_slope_vol1, 24, trd_I_slope_combi04);
-  }
-
-  // station 3
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-  {
-    TGeoBBox* trd_I_slope1_keep = new TGeoBBox("trd_I_slope1_keep", I_thick / 2., I_height / 2. - I_thick,
-                                               (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope1    = new TGeoVolume("trd_I_z31", trd_I_slope1_keep, aluminiumVolMed);
-    TGeoBBox* trd_I_slope2_keep =
-      new TGeoBBox("trd_I_slope2_keep", I_width / 2., I_thick / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope2 = new TGeoVolume("trd_I_z32", trd_I_slope2_keep, aluminiumVolMed);
-
-    trd_I_slope1->SetLineColor(kYellow);
-    trd_I_slope2->SetLineColor(kYellow);
-
-    TGeoTranslation* tz01 = new TGeoTranslation("tz01", 0., 0., 0.);
-    TGeoTranslation* tz02 = new TGeoTranslation("tz02", 0., (I_height - I_thick) / 2., 0.);
-    TGeoTranslation* tz03 = new TGeoTranslation("tz03", 0., -(I_height - I_thick) / 2., 0.);
-
-    TGeoBBox* trd_I_slope_vol1_keep =
-      new TGeoBBox("trd_I_slope_vol1_keep", I_width / 2., I_height / 2., (PilPosZ[5] - PilPosZ[4] - I_width) / 2.);
-    TGeoVolume* trd_I_slope_vol1 = new TGeoVolume("trd_I_z30", trd_I_slope_vol1_keep, keepVolMed);
-
-    // set yellow color for keeping volume of I profile, seen with gGeoManager->SetVisLevel(2)
-    trd_I_slope_vol1->SetLineColor(kYellow);
-
-    // build I-bar trd_I_slope_vol1
-    trd_I_slope_vol1->AddNode(trd_I_slope1, 1, tz01);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 2, tz02);
-    trd_I_slope_vol1->AddNode(trd_I_slope2, 3, tz03);
-
-    PilPosX = AperX[2];
-
-    TGeoCombiTrans* trd_I_slope_combi01 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 31, trd_I_slope_combi01);
-    TGeoCombiTrans* trd_I_slope_combi02 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), zBarPosYtop[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 32, trd_I_slope_combi02);
-    TGeoCombiTrans* trd_I_slope_combi03 =
-      new TGeoCombiTrans((PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 33, trd_I_slope_combi03);
-    TGeoCombiTrans* trd_I_slope_combi04 =
-      new TGeoCombiTrans(-(PilPosX + I_height / 2.), -zBarPosYbot[2], (PilPosZ[4] + PilPosZ[5]) / 2., rotz090);
-    trd_3->AddNode(trd_I_slope_vol1, 34, trd_I_slope_combi04);
-  }
-
-  if (IncludeLabels) {
-
-    Int_t text_height    = 40;
-    Int_t text_thickness = 8;
-
-    TGeoTranslation* tr200 = new TGeoTranslation(0., (AperY[0] + I_height + text_height / 2.),
-                                                 PilPosZ[0] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr201 = new TGeoTranslation(0., (AperY[1] + I_height + text_height / 2.),
-                                                 PilPosZ[2] - I_width / 2. + text_thickness / 2.);
-    TGeoTranslation* tr202 = new TGeoTranslation(0., (AperY[2] + I_height + text_height / 2.),
-                                                 PilPosZ[4] - I_width / 2. + text_thickness / 2.);
-
-    TGeoCombiTrans* tr203 =
-      new TGeoCombiTrans(-(AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty090);
-    TGeoCombiTrans* tr204 =
-      new TGeoCombiTrans(-(AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty090);
-    TGeoCombiTrans* tr205 =
-      new TGeoCombiTrans(-(AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty090);
-
-    TGeoCombiTrans* tr206 =
-      new TGeoCombiTrans((AperX[0] + I_height + text_thickness / 2.),
-                         (AperY[0] + I_height - I_width - text_height / 2.), (PilPosZ[0] + PilPosZ[1]) / 2., roty270);
-    TGeoCombiTrans* tr207 =
-      new TGeoCombiTrans((AperX[1] + I_height + text_thickness / 2.),
-                         (AperY[1] + I_height - I_width - text_height / 2.), (PilPosZ[2] + PilPosZ[3]) / 2., roty270);
-    TGeoCombiTrans* tr208 =
-      new TGeoCombiTrans((AperX[2] + I_height + text_thickness / 2.),
-                         (AperY[2] + I_height - I_width - text_height / 2.), (PilPosZ[4] + PilPosZ[5]) / 2., roty270);
-
-    TGeoVolume* trdbox1 = new TGeoVolumeAssembly("trdbox1");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox2 = new TGeoVolumeAssembly("trdbox2");  // volume for TRD text (108, 40, 8)
-    TGeoVolume* trdbox3 = new TGeoVolumeAssembly("trdbox3");  // volume for TRD text (108, 40, 8)
-    add_trd_labels(trdbox1, trdbox2, trdbox3);
-
-    // final placement
-    if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    {
-      //    trd_1->AddNode(trdbox1, 1, tr200);
-      trd_1->AddNode(trdbox1, 4, tr203);
-      trd_1->AddNode(trdbox1, 7, tr206);
-    }
-    if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    {
-      //    trd_2->AddNode(trdbox2, 2, tr201);
-      trd_2->AddNode(trdbox2, 5, tr204);
-      trd_2->AddNode(trdbox2, 8, tr207);
-    }
-    if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    {
-      //    trd_3->AddNode(trdbox3, 3, tr202);
-      trd_3->AddNode(trdbox3, 6, tr205);
-      trd_3->AddNode(trdbox3, 9, tr208);
-    }
-  }
-
-  if (ShowLayer[0])  // if geometry contains layer 1 (1st layer of station 1)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_1, 1);
-  if (ShowLayer[4])  // if geometry contains layer 5 (1st layer of station 2)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_2, 2);
-  if (ShowLayer[8])  // if geometry contains layer 9 (1st layer of station 3)
-    gGeoMan->GetVolume(geoVersion)->AddNode(trd_3, 3);
-}
diff --git a/macro/mcbm/geometry/trd_root6.patch b/macro/mcbm/geometry/trd_root6.patch
deleted file mode 100644
index 43b684a133..0000000000
--- a/macro/mcbm/geometry/trd_root6.patch
+++ /dev/null
@@ -1,366 +0,0 @@
-*** Create_TRD_Geometry_v18c_1e.C	2017-03-10 00:12:09.120667994 +0100
---- Create_TRD_Geometry_v18c_1e.C.root6	2017-03-10 00:11:37.712335658 +0100
-***************
-*** 78,83 ****
---- 78,87 ----
-  #include "TRandom3.h"
-  #include "TDatime.h"
-  
-+ #include "TGeoArb8.h"
-+ #include "TGeoTube.h"
-+ #include "TGeoCone.h"
-+ 
-  #include <iostream>
-  
-  // Name of output file with geometry
-***************
-*** 441,451 ****
-  
-  // Forward declarations
-  void create_materials_from_media_file();
-! void create_trd_module_type(Int_t moduleType);
-  void create_detector_layers(Int_t layer);
-  void create_xtru_supports();
-  void create_box_supports();
-! void add_trd_labels();
-  void create_mag_field_vector();
-  void dump_info_file();
-  void dump_digi_file();
---- 445,455 ----
-  
-  // Forward declarations
-  void create_materials_from_media_file();
-! TGeoVolume* create_trd_module_type(Int_t moduleType);
-  void create_detector_layers(Int_t layer);
-  void create_xtru_supports();
-  void create_box_supports();
-! void add_trd_labels(TGeoVolume*, TGeoVolume*, TGeoVolume*);
-  void create_mag_field_vector();
-  void dump_info_file();
-  void dump_digi_file();
-***************
-*** 516,522 ****
-    TFile* outfile = new TFile(FileNameSim,"RECREATE");
-    top->Write();      // use this as input to simulations (run_sim.C)
-    outfile->Close();
-!   TFile* outfile = new TFile(FileNameGeo,"RECREATE");
-    gGeoMan->Write();  // use this is you want GeoManager format in the output
-    outfile->Close();
-  
---- 520,526 ----
-    TFile* outfile = new TFile(FileNameSim,"RECREATE");
-    top->Write();      // use this as input to simulations (run_sim.C)
-    outfile->Close();
-!   outfile = new TFile(FileNameGeo,"RECREATE");
-    gGeoMan->Write();  // use this is you want GeoManager format in the output
-    outfile->Close();
-  
-***************
-*** 542,548 ****
-                                      DetectorSizeX[1] - 2 * FrameWidth[1] };
-    const Int_t NofSectors = 3;
-    const Int_t NofPadsInRow[2]  = { 80, 128 };  // numer of pads in rows
-!   Double_t nrow = 0;   // number of rows in module
-  
-    const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-          { {  1.50,  1.50,  1.50 },   // module type 1 -  1.01 mm2
---- 546,552 ----
-                                      DetectorSizeX[1] - 2 * FrameWidth[1] };
-    const Int_t NofSectors = 3;
-    const Int_t NofPadsInRow[2]  = { 80, 128 };  // numer of pads in rows
-!   Int_t nrow = 0;   // number of rows in module
-  
-    const Double_t PadHeightInSector[NofModuleTypes][NofSectors] =  // pad height
-          { {  1.50,  1.50,  1.50 },   // module type 1 -  1.01 mm2
-***************
-*** 592,598 ****
-      {
-        printf("WARNING: sector size does not add up to module size for module type %d\n", im+1);
-        printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1], HeightOfSector[im][2]);
-!       exit();
-      }
-  
-  //==============================================================
---- 596,602 ----
-      {
-        printf("WARNING: sector size does not add up to module size for module type %d\n", im+1);
-        printf("%.2f = %.2f + %.2f + %.2f\n", ActiveAreaX[ModuleType[im]], HeightOfSector[im][0], HeightOfSector[im][1], HeightOfSector[im][2]);
-!       exit(1);
-      }
-  
-  //==============================================================
-***************
-*** 752,771 ****
-  
-    fprintf(ifile,"# envelope\n");
-    // Show extension of TRD
-!   fprintf(ifile,"%4d cm   start of TRD (z)\n", z_first_layer);
-!   fprintf(ifile,"%4d cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-    fprintf(ifile,"\n");
-  
-    // Layer thickness
-    fprintf(ifile,"# thickness\n");
-!   fprintf(ifile,"%4d cm   per single layer (z)\n", LayerThickness);
-    fprintf(ifile,"\n");
-  
-    // Show extra gaps
-    fprintf(ifile,"# extra gaps\n ");
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-      if (ShowLayer[iLayer])
-!       fprintf(ifile,"%3d ", LayerOffset[iLayer]);
-    fprintf(ifile,"   extra gaps in z (cm)\n");
-    fprintf(ifile,"\n");
-  
---- 756,775 ----
-  
-    fprintf(ifile,"# envelope\n");
-    // Show extension of TRD
-!   fprintf(ifile,"%4f cm   start of TRD (z)\n", z_first_layer);
-!   fprintf(ifile,"%4f cm   end   of TRD (z)\n", z_last_layer + LayerThickness);
-    fprintf(ifile,"\n");
-  
-    // Layer thickness
-    fprintf(ifile,"# thickness\n");
-!   fprintf(ifile,"%4f cm   per single layer (z)\n", LayerThickness);
-    fprintf(ifile,"\n");
-  
-    // Show extra gaps
-    fprintf(ifile,"# extra gaps\n ");
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-      if (ShowLayer[iLayer])
-!       fprintf(ifile,"%3f ", LayerOffset[iLayer]);
-    fprintf(ifile,"   extra gaps in z (cm)\n");
-    fprintf(ifile,"\n");
-  
-***************
-*** 781,804 ****
-    fprintf(ifile,"# dimensions in x\n");
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-      if (ShowLayer[iLayer])
-        if (PlaneId[iLayer] < 5)
-!         fprintf(ifile,"%5d cm to %5d cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1], PlaneId[iLayer]);
-!       else if (PlaneId[iLayer] < 9)
-!         fprintf(ifile,"%5d cm to %5d cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1], PlaneId[iLayer]);
-!       else
-!         fprintf(ifile,"%5d cm to %5d cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1], PlaneId[iLayer]);
-    fprintf(ifile,"\n");
-  
-    // Dimensions in y
-    fprintf(ifile,"# dimensions in y\n");
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-      if (ShowLayer[iLayer])
-        if (PlaneId[iLayer] < 5)
-!         fprintf(ifile,"%5d cm to %5d cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1], PlaneId[iLayer]);
-!       else if (PlaneId[iLayer] < 9)
-!         fprintf(ifile,"%5d cm to %5d cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1], PlaneId[iLayer]);
-!       else
-!         fprintf(ifile,"%5d cm to %5d cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1], PlaneId[iLayer]);
-    fprintf(ifile,"\n");
-  
-    // Show layer positions
---- 785,818 ----
-    fprintf(ifile,"# dimensions in x\n");
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-      if (ShowLayer[iLayer])
-+     {
-        if (PlaneId[iLayer] < 5)
-!         fprintf(ifile,"%5f cm to %5f cm x-dimension of layer %2d\n", -3.5 * DetectorSizeX[1], 3.5 * DetectorSizeX[1], PlaneId[iLayer]);
-!       else 
-!       {
-!         if (PlaneId[iLayer] < 9)
-!           fprintf(ifile,"%5f cm to %5f cm x-dimension of layer %2d\n", -4.5 * DetectorSizeX[1], 4.5 * DetectorSizeX[1], PlaneId[iLayer]);
-!         else
-!           fprintf(ifile,"%5f cm to %5f cm x-dimension of layer %2d\n", -5.5 * DetectorSizeX[1], 5.5 * DetectorSizeX[1], PlaneId[iLayer]);
-!       }
-!     }
-    fprintf(ifile,"\n");
-  
-    // Dimensions in y
-    fprintf(ifile,"# dimensions in y\n");
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-      if (ShowLayer[iLayer])
-+     {
-        if (PlaneId[iLayer] < 5)
-!         fprintf(ifile,"%5f cm to %5f cm y-dimension of layer %2d\n", -2.5 * DetectorSizeY[1], 2.5 * DetectorSizeY[1], PlaneId[iLayer]);
-!       else 
-!       {
-!          if (PlaneId[iLayer] < 9)
-!            fprintf(ifile,"%5f cm to %5f cm y-dimension of layer %2d\n", -3.5 * DetectorSizeY[1], 3.5 * DetectorSizeY[1], PlaneId[iLayer]);
-!          else
-!            fprintf(ifile,"%5f cm to %5f cm y-dimension of layer %2d\n", -4.5 * DetectorSizeY[1], 4.5 * DetectorSizeY[1], PlaneId[iLayer]);
-!       }
-!     }
-    fprintf(ifile,"\n");
-  
-    // Show layer positions
-***************
-*** 806,812 ****
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    {
-      if (ShowLayer[iLayer])
-!       fprintf(ifile,"%5d cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-    }
-    fprintf(ifile,"\n");
-  
---- 820,826 ----
-    for (Int_t iLayer = 0; iLayer < MaxLayers; iLayer++)
-    {
-      if (ShowLayer[iLayer])
-!       fprintf(ifile,"%5f cm   z-position of layer %2d\n", LayerPosition[iLayer], PlaneId[iLayer]);
-    }
-    fprintf(ifile,"\n");
-  
-***************
-*** 1682,1687 ****
---- 1696,1702 ----
-  
-        if (IncludeAsics) 
-        {
-+         TGeoHMatrix *incline_asic;
-          // put many ASICs on each inclined FEB
-          TGeoBBox* trd_asic = new TGeoBBox("", asic_width/2., asic_thickness/2., asic_width/2.);              // ASIC dimensions
-          // TODO: use Silicon as ASICs material
-***************
-*** 1708,1714 ****
-              asic_pos_x = asic_pos * activeAreaX;
-  	    //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             TGeoHMatrix *incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, iAsic+1, incline_asic);  // now we have ASICs on the inclined FEB
-            }
---- 1723,1729 ----
-              asic_pos_x = asic_pos * activeAreaX;
-  	    //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, iAsic+1, incline_asic);  // now we have ASICs on the inclined FEB
-            }
-***************
-*** 1721,1727 ****
-              asic_pos_x = asic_pos * activeAreaX + (0.5 + asic_distance/2.) * asic_width;
-  	    //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB);
-!             TGeoHMatrix *incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 2*iAsic+1, incline_asic);  // now we have ASICs on the inclined FEB
-  
---- 1736,1742 ----
-              asic_pos_x = asic_pos * activeAreaX + (0.5 + asic_distance/2.) * asic_width;
-  	    //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB);
-!             incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 2*iAsic+1, incline_asic);  // now we have ASICs on the inclined FEB
-  
-***************
-*** 1729,1735 ****
-              asic_pos_x = asic_pos * activeAreaX - (0.5 + asic_distance/2.) * asic_width;
-  	    //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             TGeoHMatrix *incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 2*iAsic+2, incline_asic);  // now we have ASICs on the inclined FEB
-            }
---- 1744,1750 ----
-              asic_pos_x = asic_pos * activeAreaX - (0.5 + asic_distance/2.) * asic_width;
-  	    //            trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2., 0.);  // move asic on top of FEB
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 2*iAsic+2, incline_asic);  // now we have ASICs on the inclined FEB
-            }
-***************
-*** 1741,1761 ****
-              // ASIC 1
-              asic_pos_x = asic_pos * activeAreaX + 1.1 * asic_width; // (0.5 + asic_distance/2.) * asic_width;
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB);
-!             TGeoHMatrix *incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 3*iAsic+1, incline_asic);  // now we have ASICs on the inclined FEB
-  
-              // ASIC 2
-              asic_pos_x = asic_pos * activeAreaX;
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             TGeoHMatrix *incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 3*iAsic+2, incline_asic);  // now we have ASICs on the inclined FEB
-  
-              // ASIC 3
-              asic_pos_x = asic_pos * activeAreaX - 1.1 * asic_width; // (0.5 + asic_distance/2.) * asic_width;
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             TGeoHMatrix *incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 3*iAsic+3, incline_asic);  // now we have ASICs on the inclined FEB
-            }
---- 1756,1776 ----
-              // ASIC 1
-              asic_pos_x = asic_pos * activeAreaX + 1.1 * asic_width; // (0.5 + asic_distance/2.) * asic_width;
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB);
-!             incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 3*iAsic+1, incline_asic);  // now we have ASICs on the inclined FEB
-  
-              // ASIC 2
-              asic_pos_x = asic_pos * activeAreaX;
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 3*iAsic+2, incline_asic);  // now we have ASICs on the inclined FEB
-  
-              // ASIC 3
-              asic_pos_x = asic_pos * activeAreaX - 1.1 * asic_width; // (0.5 + asic_distance/2.) * asic_width;
-              trd_asic_trans1     = new TGeoTranslation("", asic_pos_x, feb_thickness/2.+asic_thickness/2.+asic_offset, 0.);  // move asic on top of FEB
-!             incline_asic = new TGeoHMatrix("");
-              (*incline_asic) = (*trd_asic_trans1) * (*incline_feb);
-              trd_feb_box->AddNode(trdmod1_asic, 3*iAsic+3, incline_asic);  // now we have ASICs on the inclined FEB
-            }
-***************
-*** 1917,1930 ****
-    Int_t* outerLayer;
-    
-    if ( 1 == layerType ) {
-!     innerLayer = layer1i;      
-!     outerLayer = layer1o; 
-    } else if ( 2 == layerType ) {
-!     innerLayer = layer2i;      
-!     outerLayer = layer2o; 
-    } else if ( 3 == layerType ) {
-!     innerLayer = layer3i;      
-!     outerLayer = layer3o; 
-    } else {
-      std::cout << "Type of layer not known" << std::endl;
-    } 
---- 1932,1945 ----
-    Int_t* outerLayer;
-    
-    if ( 1 == layerType ) {
-!     innerLayer = (Int_t*) layer1i;      
-!     outerLayer = (Int_t*) layer1o; 
-    } else if ( 2 == layerType ) {
-!     innerLayer = (Int_t*) layer2i;      
-!     outerLayer = (Int_t*) layer2o; 
-    } else if ( 3 == layerType ) {
-!     innerLayer = (Int_t*) layer3i;      
-!     outerLayer = (Int_t*) layer3o; 
-    } else {
-      std::cout << "Type of layer not known" << std::endl;
-    } 
-***************
-*** 2481,2487 ****
-  }
-  
-  
-! add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-  {
-  // write TRD (the 3 characters) in a simple geometry
-    TGeoMedium* textVolMed        = gGeoMan->GetMedium(TextVolumeMedium);
---- 2496,2502 ----
-  }
-  
-  
-! void add_trd_labels(TGeoVolume* trdbox1, TGeoVolume* trdbox2, TGeoVolume* trdbox3)
-  {
-  // write TRD (the 3 characters) in a simple geometry
-    TGeoMedium* textVolMed        = gGeoMan->GetMedium(TextVolumeMedium);
diff --git a/macro/mcbm/geometry/trd_v17a_to_v18e.patch b/macro/mcbm/geometry/trd_v17a_to_v18e.patch
deleted file mode 100644
index d3c80a484e..0000000000
--- a/macro/mcbm/geometry/trd_v17a_to_v18e.patch
+++ /dev/null
@@ -1,242 +0,0 @@
-*** Create_TRD_Geometry_v17a.C	2017-05-02 12:31:02.455558193 +0200
---- Create_TRD_Geometry_v18e.C	2017-05-02 12:27:31.276168745 +0200
-***************
-*** 1,5 ****
-  ///                                             
-! /// \file Create_TRD_Geometry_v17a.C
-  /// \brief Generates TRD geometry in Root format.
-  ///                                             
-  
---- 1,5 ----
-  ///                                             
-! /// \file Create_TRD_Geometry_v18e.C
-  /// \brief Generates TRD geometry in Root format.
-  ///                                             
-  
-***************
-*** 88,94 ****
-  #include <iostream>
-  
-  // Name of output file with geometry
-! const TString tagVersion   = "v17a";
-  //const TString subVersion   = "_1h";
-  //const TString subVersion   = "_1e";
-  //const TString subVersion   = "_1m";
---- 88,94 ----
-  #include <iostream>
-  
-  // Name of output file with geometry
-! const TString tagVersion   = "v18e";
-  //const TString subVersion   = "_1h";
-  //const TString subVersion   = "_1e";
-  //const TString subVersion   = "_1m";
-***************
-*** 96,113 ****
-  //const TString subVersion   = "_3m";
-  
-  const Int_t setupid = 1;  // 1e is the default
-! const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-  const TString setupVer[5] = { "_1h", "_1e", "_1m", "_3e", "_3m" };
-  const TString subVersion = setupVer[setupid];
-  
-  const TString geoVersion   = "trd_" + tagVersion + subVersion;
-! const TString FileNameSim  = geoVersion + ".geo.root";
-! const TString FileNameGeo  = geoVersion + "_geo.root";
-! const TString FileNameInfo = geoVersion + ".geo.info";
-  const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-  
-  // display switches
-! const Bool_t IncludeRadiator    = true;  // false;  // true, if radiator is included in geometry
-  const Bool_t IncludeLattice     = true;  // false;  // true, if lattice grid is included in geometry
-  
-  const Bool_t IncludeKaptonFoil  = true;  // false;  // true, if entrance window is included in geometry
---- 96,114 ----
-  //const TString subVersion   = "_3m";
-  
-  const Int_t setupid = 1;  // 1e is the default
-! //const Double_t zfront[5]  = { 260., 410., 360., 410., 550. };
-! const Double_t zfront[5]  = { 260., 110., 360., 410., 550. };
-  const TString setupVer[5] = { "_1h", "_1e", "_1m", "_3e", "_3m" };
-  const TString subVersion = setupVer[setupid];
-  
-  const TString geoVersion   = "trd_" + tagVersion + subVersion;
-! const TString FileNameSim  = geoVersion + "_mcbm.geo.root";
-! const TString FileNameGeo  = geoVersion + "_mcbm_geo.root";
-! const TString FileNameInfo = geoVersion + "_mcbm.geo.info";
-  const TString FileNamePads = "CbmTrdPads_" + tagVersion + ".h";
-  
-  // display switches
-! const Bool_t IncludeRadiator    = false;  // false;  // true, if radiator is included in geometry
-  const Bool_t IncludeLattice     = true;  // false;  // true, if lattice grid is included in geometry
-  
-  const Bool_t IncludeKaptonFoil  = true;  // false;  // true, if entrance window is included in geometry
-***************
-*** 115,127 ****
-  const Bool_t IncludePadplane    = true;  // false;  // true, if padplane is included in geometry
-  const Bool_t IncludeBackpanel   = true;  // false;  // true, if backpanel is included in geometry
-  const Bool_t IncludeAluLedge    = true;  // false;  // true, if Al-ledge around the backpanel is included in geometry
-! const Bool_t IncludePowerbars   = true;  // false;  // true, if LV copper bus bars to be drawn
-  
-  const Bool_t IncludeFebs        = true;  // false;  // true, if FEBs are included in geometry
-  const Bool_t IncludeRobs        = true;  // false;  // true, if ROBs are included in geometry
-  const Bool_t IncludeAsics       = true;  // false;  // true, if ASICs are included in geometry
-! const Bool_t IncludeSupports    = true;  // false;  // true, if support structure is included in geometry
-! const Bool_t IncludeLabels      = true;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-  const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-  
-  // positioning switches
---- 116,128 ----
-  const Bool_t IncludePadplane    = true;  // false;  // true, if padplane is included in geometry
-  const Bool_t IncludeBackpanel   = true;  // false;  // true, if backpanel is included in geometry
-  const Bool_t IncludeAluLedge    = true;  // false;  // true, if Al-ledge around the backpanel is included in geometry
-! const Bool_t IncludePowerbars   = false;  // false;  // true, if LV copper bus bars to be drawn
-  
-  const Bool_t IncludeFebs        = true;  // false;  // true, if FEBs are included in geometry
-  const Bool_t IncludeRobs        = true;  // false;  // true, if ROBs are included in geometry
-  const Bool_t IncludeAsics       = true;  // false;  // true, if ASICs are included in geometry
-! const Bool_t IncludeSupports    = false;  // false;  // true, if support structure is included in geometry
-! const Bool_t IncludeLabels      = false;  // false;  // true, if TRD (I, II, III) labels are plotted in (VisLevel 5)
-  const Bool_t IncludeFieldVector = false;  // true, if magnetic field vector to be shown (in the magnet)
-  
-  // positioning switches
-***************
-*** 198,204 ****
-  //Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-  
-  
-! const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-  
-  const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   5.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness 
-  //const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness 
---- 199,206 ----
-  //Double_t LayerPosition[MaxLayers] = { 460. }; // start position - 2013-06-25 - DE - v13n trd300_rich_stretched   (10 layers, z = 4600 )
-  
-  
-! const Double_t LayerThickness = 25.0; // miniCBM - Thickness of one TRD layer in cm
-! //const Double_t LayerThickness = 45.0; // Thickness of one TRD layer in cm
-  
-  const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   5.,   0.,   0.,   0.,   5.,   0. };  // v13x[4,5] - z offset in addition to LayerThickness 
-  //const Double_t LayerOffset[MaxLayers] = {   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0. };  // SIS100 - z offset in addition to LayerThickness 
-***************
-*** 211,233 ****
-  
-  // ### Layer Type 1
-  // v14x - module types in the inner sector of layer type 1 - looking upstream
-! const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-!                               { 223,  123,  121,  121,  221 },  
-!                               { 203,  103,    0,  101,  201 },  
-!                               { 203,  103,  101,  101,  201 },  
-!                               { 303,  303,  301,  301,  301 } };
-  // number of modules: 24
-  
-  // v14x - module types in the outer sector of layer type 1 - looking upstream
-  const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-                                {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-!                               {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-!                               {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-!                               {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-!                               {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-!                               {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-                                {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-                                {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-  // number of modules: 26
-  // Layer1 =  24 + 26;   // v14a
-  
---- 213,252 ----
-  
-  // ### Layer Type 1
-  // v14x - module types in the inner sector of layer type 1 - looking upstream
-! const Int_t layer1i[5][5] = { {   0,    0,    0,    0,    0 },  
-!                               {   0,    0,    0,    0,    0 },  
-!                               {   0,    0,    0,    0,    0 },  
-! 			      //                            {   0,    0,  101,    0,    0 },  
-!                               {   0,    0,    0,    0,    0 },  
-!                               {   0,    0,    0,    0,    0 } };
-! 
-! //const Int_t layer1i[5][5] = { { 323,  323,  321,  321,  321 },    // abc: a module type - b orientation (x90 deg) in odd - c even layers
-! //                              { 223,  123,  121,  121,  221 },  
-! //                              { 203,  103,    0,  101,  201 },  
-! //                              { 203,  103,  101,  101,  201 },  
-! //                              { 303,  303,  301,  301,  301 } };
-  // number of modules: 24
-  
-  // v14x - module types in the outer sector of layer type 1 - looking upstream
-  const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-                                {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-!                               {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-!                               {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-!                               {  0,    0,    0,    0,    0,  821,    0,    0,    0,    0,    0 },
-!                               {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-!                               {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-                                {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-                                {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-+ //// v14x - module types in the outer sector of layer type 1 - looking upstream
-+ //const Int_t layer1o[9][11]= { {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-+ //                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-+ //                              {  0,    0,  823,  823,  723,  721,  721,  821,  821,    0,    0 },
-+ //                              {  0,    0,  823,  623,    0,    0,    0,  621,  821,    0,    0 },
-+ //                              {  0,    0,  703,  603,    0,    0,    0,  601,  701,    0,    0 },
-+ //                              {  0,    0,  803,  603,    0,    0,    0,  601,  801,    0,    0 },
-+ //                              {  0,    0,  803,  803,  703,  701,  701,  801,  801,    0,    0 },
-+ //                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 },
-+ //                              {  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 } };
-  // number of modules: 26
-  // Layer1 =  24 + 26;   // v14a
-  
-***************
-*** 299,306 ****
-  //const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-  
-  // super density for type 1 modules - 2017 - 540 mm
-! //const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside
-! const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-  const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,210,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-  //// ultimate density - 540 mm
-  //const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
---- 318,325 ----
-  //const Int_t RobTypeOnModule[NofModuleTypes] = { 77, 53,  5,  0,  0, 55,  5,  3 }; // for .geo.info - TODO: merge with above GbtxPerRob
-  
-  // super density for type 1 modules - 2017 - 540 mm
-! const Int_t FebsPerModule[NofModuleTypes] = {  9,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside
-! //const Int_t FebsPerModule[NofModuleTypes] = {  9,  6,  3,  4, 12,  8,  4,  2 }; // number of FEBs on backside
-  const Int_t AsicsPerFeb[NofModuleTypes]   = {210,210,210,105,108,108,108,108 }; // %100 gives number of ASICs on FEB, /100 gives grouping
-  //// ultimate density - 540 mm
-  //const Int_t FebsPerModule[NofModuleTypes] = {  6,  5,  6,  4, 12,  8,  4,  3 }; // number of FEBs on backside - reduced FEBs (64 ch ASICs)
-***************
-*** 370,377 ****
-  Int_t ModuleStats[MaxLayers][NofModuleTypes] = { 0 };
-  
-  // z - geometry of TRD modules
-! //const Double_t radiator_thickness     =  35.0;    // 35 cm thickness of radiator
-! const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-  const Double_t radiator_position      =  - LayerThickness/2. + radiator_thickness/2.;
-  
-  //const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
---- 389,396 ----
-  Int_t ModuleStats[MaxLayers][NofModuleTypes] = { 0 };
-  
-  // z - geometry of TRD modules
-! const Double_t radiator_thickness     =  0.0;    // 35 cm thickness of radiator
-! //const Double_t radiator_thickness     =  30.0;    // 30 cm thickness of radiator + shift pad plane to integer multiple of 1 mm
-  const Double_t radiator_position      =  - LayerThickness/2. + radiator_thickness/2.;
-  
-  //const Double_t lattice_thickness      =   1.0;  // 1.0;  // 10 mm thick lattice frames
-***************
-*** 464,471 ****
-  void dump_digi_file();
-  
-  
-! //void Create_TRD_Geometry_v17a(const Int_t setupid = 1) {
-! void Create_TRD_Geometry_v17a() {
-  
-    // declare TRD layer layout
-    if (setupid > 2)
---- 483,490 ----
-  void dump_digi_file();
-  
-  
-! //void Create_TRD_Geometry_v18e(const Int_t setupid = 1) {
-! void Create_TRD_Geometry_v18e() {
-  
-    // declare TRD layer layout
-    if (setupid > 2)
-- 
GitLab